Skip to content

Commit

Permalink
remove base-compat and base-compat-batteries (#320)
Browse files Browse the repository at this point in the history
* remove base-compat and base-compat-batteries
  • Loading branch information
ocramz authored Oct 3, 2023
1 parent 2dc19af commit 1928910
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 44 deletions.
4 changes: 0 additions & 4 deletions Web/Scotty/Action.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
Expand Down Expand Up @@ -79,9 +78,6 @@ import Network.Wai (Request, Response, StreamingBody, Application, req

import Numeric.Natural

import Prelude ()
import "base-compat-batteries" Prelude.Compat

import Web.Scotty.Internal.Types
import Web.Scotty.Util (mkResponse, addIfNotPresent, add, replace, lazyTextToStrictByteString, strictByteStringToLazyText)
import Web.Scotty.Exceptions (Handler(..), catch, catchesOptionally, tryAny)
Expand Down
3 changes: 0 additions & 3 deletions Web/Scotty/Internal/Types.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DerivingStrategies #-}
Expand Down Expand Up @@ -44,8 +43,6 @@ import Network.Wai.Parse (FileInfo)

import Web.Scotty.Exceptions (Handler(..), catch, catches)

import Prelude ()
import "base-compat-batteries" Prelude.Compat

--------------------- Options -----------------------
data Options = Options { verbose :: Int -- ^ 0 = silent, 1(def) = startup banner
Expand Down
4 changes: 0 additions & 4 deletions Web/Scotty/Route.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{-# LANGUAGE FlexibleContexts, FlexibleInstances,
OverloadedStrings, RankNTypes, ScopedTypeVariables #-}
{-# language PackageImports #-}
module Web.Scotty.Route
( get, post, put, delete, patch, options, addroute, matchAny, notFound,
capture, regex, function, literal
Expand All @@ -22,9 +21,6 @@ import qualified Data.Text as TS
import Network.HTTP.Types
import Network.Wai (Request(..))

import Prelude ()
import "base-compat-batteries" Prelude.Compat

import qualified Text.Regex as Regex

import Web.Scotty.Action
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## next [????.??.??]

* remove dependencies on 'base-compat' and 'base-compat-batteries' (#318)

## 0.20 [2023.10.02]
* Drop support for GHC < 8.10 and modernise the CI pipeline (#300).
* Adds a new `nested` handler that allows you to place an entire WAI Application under a Scotty route (#233).
Expand Down
2 changes: 0 additions & 2 deletions examples/basic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import Data.Text.Lazy (pack)
import Data.Text.Lazy.Encoding (decodeUtf8)
import Data.String (fromString)
import Data.Typeable (Typeable)
import Prelude ()
import Prelude.Compat

data Err = Boom | UserAgentNotFound | NeverReached deriving (Show, Typeable, Exception)

Expand Down
3 changes: 0 additions & 3 deletions examples/exceptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import Data.Typeable
import Network.HTTP.Types
import Network.Wai.Middleware.RequestLogger

import Prelude ()
import Prelude.Compat

import System.Random

import Web.Scotty.Trans
Expand Down
3 changes: 0 additions & 3 deletions examples/globalstate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ import Data.String

import Network.Wai.Middleware.RequestLogger

import Prelude ()
import Prelude.Compat

import Web.Scotty.Trans

newtype AppState = AppState { tickCount :: Int }
Expand Down
2 changes: 0 additions & 2 deletions examples/reader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ module Main where
import Control.Monad.Reader (MonadIO, MonadReader, ReaderT, asks, lift, runReaderT)
import Control.Monad.IO.Unlift (MonadUnliftIO(..))
import Data.Text.Lazy (pack)
import Prelude ()
import Prelude.Compat
import Web.Scotty.Trans (ScottyT, defaultOptions, get, scottyOptsT, text)

data Config = Config
Expand Down
23 changes: 6 additions & 17 deletions examples/scotty-examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,23 @@ License: BSD3
License-file: LICENSE
Author: Andrew Farmer <[email protected]>
Maintainer: Andrew Farmer <[email protected]>
Copyright: (c) 2012-Present Andrew Farmer
Copyright: (c) 2012-Present, Andrew Farmer and the Scotty contributors
Category: Web
Stability: experimental
Build-type: Simple
Cabal-version: >= 1.10
Description: Example programs using @scotty@
tested-with: GHC == 7.6.3
, GHC == 7.8.4
, GHC == 7.10.3
, GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.4
, GHC == 8.6.5
, GHC == 8.8.4
, GHC == 8.10.4
, GHC == 9.0.1
tested-with: GHC == 8.10.7
, GHC == 9.0.2
, GHC == 9.2.8
, GHC == 9.4.6
, GHC == 9.6.2

executable scotty-basic
main-is: basic.hs
default-language: Haskell2010
hs-source-dirs: .
build-depends: base >= 4.6 && < 5,
base-compat >= 0.11 && < 0.13,
http-types,
mtl,
random,
Expand Down Expand Up @@ -68,7 +62,6 @@ executable scotty-exceptions
default-language: Haskell2010
hs-source-dirs: .
build-depends: base >= 4.6 && < 5,
base-compat >= 0.11 && < 0.13,
http-types,
random,
scotty,
Expand All @@ -81,7 +74,6 @@ executable scotty-globalstate
default-language: Haskell2010
hs-source-dirs: .
build-depends: base >= 4.6 && < 5,
base-compat >= 0.11 && < 0.13,
mtl,
scotty,
stm,
Expand Down Expand Up @@ -115,7 +107,6 @@ executable scotty-reader
default-language: Haskell2010
hs-source-dirs: .
build-depends: base >= 4.6 && < 5,
base-compat >= 0.11 && < 0.13,
mtl,
scotty,
text,
Expand All @@ -127,7 +118,6 @@ executable scotty-upload
default-language: Haskell2010
hs-source-dirs: .
build-depends: base >= 4.6 && < 5,
base-compat >= 0.11 && < 0.13,
blaze-html,
bytestring,
filepath,
Expand All @@ -142,7 +132,6 @@ executable scotty-urlshortener
default-language: Haskell2010
hs-source-dirs: .
build-depends: base >= 4.6 && < 5,
base-compat >= 0.11 && < 0.13,
blaze-html,
containers,
scotty,
Expand Down
2 changes: 0 additions & 2 deletions examples/upload.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import Text.Blaze.Html.Renderer.Text (renderHtml)
import qualified Data.ByteString.Lazy as B
import qualified Data.ByteString.Char8 as BS
import System.FilePath ((</>))
import Prelude ()
import Prelude.Compat

main :: IO ()
main = scotty 3000 $ do
Expand Down
3 changes: 0 additions & 3 deletions examples/urlshortener.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ import Data.Typeable (Typeable)
import Network.Wai.Middleware.RequestLogger
import Network.Wai.Middleware.Static

import Prelude ()
import Prelude.Compat

import qualified Text.Blaze.Html5 as H
import Text.Blaze.Html5.Attributes
-- Note:
Expand Down
1 change: 0 additions & 1 deletion scotty.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ Library
default-language: Haskell2010
build-depends: aeson >= 0.6.2.1 && < 2.3,
base >= 4.6 && < 5,
base-compat-batteries >= 0.10 && < 0.14,
blaze-builder >= 0.3.3.0 && < 0.5,
bytestring >= 0.10.0.2 && < 0.12,
case-insensitive >= 1.0.0.1 && < 1.3,
Expand Down

0 comments on commit 1928910

Please sign in to comment.