From 192891033448306dabdb743d17951de09c01e549 Mon Sep 17 00:00:00 2001 From: Marco Z Date: Tue, 3 Oct 2023 11:40:06 +0200 Subject: [PATCH] remove base-compat and base-compat-batteries (#320) * remove base-compat and base-compat-batteries --- Web/Scotty/Action.hs | 4 ---- Web/Scotty/Internal/Types.hs | 3 --- Web/Scotty/Route.hs | 4 ---- changelog.md | 2 ++ examples/basic.hs | 2 -- examples/exceptions.hs | 3 --- examples/globalstate.hs | 3 --- examples/reader.hs | 2 -- examples/scotty-examples.cabal | 23 ++++++----------------- examples/upload.hs | 2 -- examples/urlshortener.hs | 3 --- scotty.cabal | 1 - 12 files changed, 8 insertions(+), 44 deletions(-) diff --git a/Web/Scotty/Action.hs b/Web/Scotty/Action.hs index 726240f5..a1043e61 100644 --- a/Web/Scotty/Action.hs +++ b/Web/Scotty/Action.hs @@ -1,6 +1,5 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE PackageImports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} @@ -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) diff --git a/Web/Scotty/Internal/Types.hs b/Web/Scotty/Internal/Types.hs index efad224d..3d2c7d22 100644 --- a/Web/Scotty/Internal/Types.hs +++ b/Web/Scotty/Internal/Types.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE PackageImports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DerivingStrategies #-} @@ -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 diff --git a/Web/Scotty/Route.hs b/Web/Scotty/Route.hs index c8f80be2..5ebaf3d4 100644 --- a/Web/Scotty/Route.hs +++ b/Web/Scotty/Route.hs @@ -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 @@ -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 diff --git a/changelog.md b/changelog.md index f6f22077..2163b527 100644 --- a/changelog.md +++ b/changelog.md @@ -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). diff --git a/examples/basic.hs b/examples/basic.hs index ef9ca7e2..941bcac2 100644 --- a/examples/basic.hs +++ b/examples/basic.hs @@ -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) diff --git a/examples/exceptions.hs b/examples/exceptions.hs index 3e4f3c7e..d0fc4928 100644 --- a/examples/exceptions.hs +++ b/examples/exceptions.hs @@ -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 diff --git a/examples/globalstate.hs b/examples/globalstate.hs index 7a433e0b..7e4ab914 100644 --- a/examples/globalstate.hs +++ b/examples/globalstate.hs @@ -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 } diff --git a/examples/reader.hs b/examples/reader.hs index b1f67258..855cbccf 100644 --- a/examples/reader.hs +++ b/examples/reader.hs @@ -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 diff --git a/examples/scotty-examples.cabal b/examples/scotty-examples.cabal index de36659e..3e8377a0 100644 --- a/examples/scotty-examples.cabal +++ b/examples/scotty-examples.cabal @@ -7,29 +7,23 @@ License: BSD3 License-file: LICENSE Author: Andrew Farmer Maintainer: Andrew Farmer -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/examples/upload.hs b/examples/upload.hs index 2e4bec1c..15fbf89a 100644 --- a/examples/upload.hs +++ b/examples/upload.hs @@ -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 diff --git a/examples/urlshortener.hs b/examples/urlshortener.hs index 854e8108..d171eb1d 100644 --- a/examples/urlshortener.hs +++ b/examples/urlshortener.hs @@ -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: diff --git a/scotty.cabal b/scotty.cabal index 6a4de172..07dfb7ba 100644 --- a/scotty.cabal +++ b/scotty.cabal @@ -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,