diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 2ce0a91c..e155a0f4 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -20,6 +20,7 @@ jobs: - "8.10.7" - "9.0.2" - "9.2.2" + - "9.4.2" steps: - uses: actions/checkout@v2 diff --git a/cabal.project b/cabal.project index 42e8057b..3a3bea24 100644 --- a/cabal.project +++ b/cabal.project @@ -51,3 +51,8 @@ packages: tests: True optimization: False -- reorder-goals: True + +allow-newer: +-- see https://github.com/haskellari/postgresql-simple/issues/104 + postgresql-simple:base + , postgresql-simple:template-haskell diff --git a/servant-auth/servant-auth-client/servant-auth-client.cabal b/servant-auth/servant-auth-client/servant-auth-client.cabal index 621bf832..02092fec 100644 --- a/servant-auth/servant-auth-client/servant-auth-client.cabal +++ b/servant-auth/servant-auth-client/servant-auth-client.cabal @@ -31,7 +31,7 @@ library default-extensions: ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators ghc-options: -Wall build-depends: - base >= 4.10 && < 4.17 + base >= 4.10 && < 4.18 , bytestring >= 0.10.6.0 && < 0.12 , containers >= 0.5.6.2 && < 0.7 , servant-auth == 0.4.* diff --git a/servant-auth/servant-auth-docs/servant-auth-docs.cabal b/servant-auth/servant-auth-docs/servant-auth-docs.cabal index 802b587f..f2bdeb8b 100644 --- a/servant-auth/servant-auth-docs/servant-auth-docs.cabal +++ b/servant-auth/servant-auth-docs/servant-auth-docs.cabal @@ -35,7 +35,7 @@ library default-extensions: ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators ghc-options: -Wall build-depends: - base >= 4.10 && < 4.17 + base >= 4.10 && < 4.18 , servant-docs >= 0.11.2 && < 0.13 , servant >= 0.13 && < 0.20 , servant-auth == 0.4.* @@ -50,7 +50,7 @@ test-suite doctests build-depends: base, servant-auth-docs, - doctest >= 0.16 && < 0.19, + doctest >= 0.16 && < 0.21, QuickCheck >= 2.11.3 && < 2.15, template-haskell ghc-options: -Wall -threaded diff --git a/servant-auth/servant-auth-server/servant-auth-server.cabal b/servant-auth/servant-auth-server/servant-auth-server.cabal index d45fd769..00535d30 100644 --- a/servant-auth/servant-auth-server/servant-auth-server.cabal +++ b/servant-auth/servant-auth-server/servant-auth-server.cabal @@ -31,7 +31,7 @@ library default-extensions: ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators ghc-options: -Wall build-depends: - base >= 4.10 && < 4.17 + base >= 4.10 && < 4.18 , aeson >= 1.0.0.1 && < 3 , base64-bytestring >= 1.0.0.1 && < 2 , blaze-builder >= 0.4.1.0 && < 0.5 @@ -43,7 +43,7 @@ library , http-types >= 0.12.2 && < 0.13 , jose >= 0.7.0.0 && < 0.10 , lens >= 4.16.1 && < 5.3 - , memory >= 0.14.16 && < 0.18 + , memory >= 0.14.16 && < 0.19 , monad-time >= 0.3.1.0 && < 0.4 , mtl >= 2.2.2 && < 2.3 , servant >= 0.13 && < 0.20 @@ -51,7 +51,7 @@ library , servant-server >= 0.13 && < 0.20 , tagged >= 0.8.4 && < 0.9 , text >= 1.2.3.0 && < 2.1 - , time >= 1.5.0.1 && < 1.12 + , time >= 1.5.0.1 && < 1.13 , unordered-containers >= 0.2.9.0 && < 0.3 , wai >= 3.2.1.2 && < 3.3 diff --git a/servant-auth/servant-auth-swagger/servant-auth-swagger.cabal b/servant-auth/servant-auth-swagger/servant-auth-swagger.cabal index fae37e83..f02f3c77 100644 --- a/servant-auth/servant-auth-swagger/servant-auth-swagger.cabal +++ b/servant-auth/servant-auth-swagger/servant-auth-swagger.cabal @@ -31,7 +31,7 @@ library default-extensions: ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators ghc-options: -Wall build-depends: - base >= 4.10 && < 4.17 + base >= 4.10 && < 4.18 , text >= 1.2.3.0 && < 2.1 , servant-swagger >= 1.1.5 && < 2 , swagger2 >= 2.2.2 && < 3 diff --git a/servant-auth/servant-auth/servant-auth.cabal b/servant-auth/servant-auth/servant-auth.cabal index 5f7d8810..79c8a396 100644 --- a/servant-auth/servant-auth/servant-auth.cabal +++ b/servant-auth/servant-auth/servant-auth.cabal @@ -33,7 +33,7 @@ library default-extensions: ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators ghc-options: -Wall build-depends: - base >= 4.10 && < 4.17 + base >= 4.10 && < 4.18 , containers >= 0.6 && < 0.7 , aeson >= 1.3.1.1 && < 3 , jose >= 0.7.0.0 && < 0.10 diff --git a/servant-client-core/servant-client-core.cabal b/servant-client-core/servant-client-core.cabal index 34af6889..9994832d 100644 --- a/servant-client-core/servant-client-core.cabal +++ b/servant-client-core/servant-client-core.cabal @@ -50,14 +50,14 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.9 && < 4.17 + base >= 4.9 && < 4.18 , bytestring >= 0.10.8.1 && < 0.12 , constraints >= 0.2 && < 0.14 , containers >= 0.5.7.1 && < 0.7 , deepseq >= 1.4.2.0 && < 1.5 , text >= 1.2.3.0 && < 2.1 , transformers >= 0.5.2.0 && < 0.6 - , template-haskell >= 2.11.1.0 && < 2.19 + , template-haskell >= 2.11.1.0 && < 2.20 if !impl(ghc >= 8.2) build-depends: diff --git a/servant-client/servant-client.cabal b/servant-client/servant-client.cabal index ae628b38..8c0b51fe 100644 --- a/servant-client/servant-client.cabal +++ b/servant-client/servant-client.cabal @@ -41,14 +41,14 @@ library -- Bundled with GHC: Lower bound to not force re-installs -- text and mtl are bundled starting with GHC-8.4 build-depends: - base >= 4.9 && < 4.17 + base >= 4.9 && < 4.18 , bytestring >= 0.10.8.1 && < 0.12 , containers >= 0.5.7.1 && < 0.7 , deepseq >= 1.4.2.0 && < 1.5 , mtl >= 2.2.2 && < 2.3 , stm >= 2.4.5.1 && < 2.6 , text >= 1.2.3.0 && < 2.1 - , time >= 1.6.0.1 && < 1.12 + , time >= 1.6.0.1 && < 1.13 , transformers >= 0.5.2.0 && < 0.6 if !impl(ghc >= 8.2) diff --git a/servant-docs/servant-docs.cabal b/servant-docs/servant-docs.cabal index 52c8f084..59612621 100644 --- a/servant-docs/servant-docs.cabal +++ b/servant-docs/servant-docs.cabal @@ -41,7 +41,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.9 && < 4.17 + base >= 4.9 && < 4.18 , bytestring >= 0.10.8.1 && < 0.12 , text >= 1.2.3.0 && < 2.1 diff --git a/servant-foreign/servant-foreign.cabal b/servant-foreign/servant-foreign.cabal index 99f6c5a5..6cb4ba82 100644 --- a/servant-foreign/servant-foreign.cabal +++ b/servant-foreign/servant-foreign.cabal @@ -41,7 +41,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.9 && < 4.17 + base >= 4.9 && < 4.18 , text >= 1.2.3.0 && < 2.1 -- Servant dependencies diff --git a/servant-http-streams/servant-http-streams.cabal b/servant-http-streams/servant-http-streams.cabal index 1282da1f..9ba10121 100644 --- a/servant-http-streams/servant-http-streams.cabal +++ b/servant-http-streams/servant-http-streams.cabal @@ -38,13 +38,13 @@ library -- Bundled with GHC: Lower bound to not force re-installs -- text and mtl are bundled starting with GHC-8.4 build-depends: - base >= 4.9 && < 4.17 + base >= 4.9 && < 4.18 , bytestring >= 0.10.8.1 && < 0.12 , containers >= 0.5.7.1 && < 0.7 , deepseq >= 1.4.2.0 && < 1.5 , mtl >= 2.2.2 && < 2.3 , text >= 1.2.3.0 && < 2.1 - , time >= 1.6.0.1 && < 1.12 + , time >= 1.6.0.1 && < 1.13 , transformers >= 0.5.2.0 && < 0.6 if !impl(ghc >= 8.2) diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index f354a1e8..5d5bfb76 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -60,7 +60,7 @@ library -- Bundled with GHC: Lower bound to not force re-installs -- text and mtl are bundled starting with GHC-8.4 build-depends: - base >= 4.9 && < 4.17 + base >= 4.9 && < 4.18 , bytestring >= 0.10.8.1 && < 0.12 , constraints >= 0.2 && < 0.14 , containers >= 0.5.7.1 && < 0.7 @@ -73,7 +73,7 @@ library -- strict dependency as we re-export 'servant' things. build-depends: servant >= 0.19 && < 0.20 - , http-api-data >= 0.4.1 && < 0.4.4 + , http-api-data >= 0.4.1 && < 0.5.1 -- Other dependencies: Lower bound around what is in the latest Stackage LTS. -- Here can be exceptions if we really need features from the newer versions. diff --git a/servant-server/src/Servant/Server/Internal.hs b/servant-server/src/Servant/Server/Internal.hs index a2b4f033..a4d74564 100644 --- a/servant-server/src/Servant/Server/Internal.hs +++ b/servant-server/src/Servant/Server/Internal.hs @@ -1,5 +1,6 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} @@ -94,6 +95,8 @@ import Servant.API.TypeErrors import Web.HttpApiData (FromHttpApiData, parseHeader, parseQueryParam, parseUrlPiece, parseUrlPieces) +import Data.Kind + (Type) import Servant.Server.Internal.BasicAuth import Servant.Server.Internal.Context @@ -821,7 +824,11 @@ instance (HasContextEntry context (NamedContext name subContext), HasServer subA ------------------------------------------------------------------------------- -- Erroring instance for 'HasServer' when a combinator is not fully applied -instance TypeError (PartialApplication HasServer arr) => HasServer ((arr :: a -> b) :> sub) context +instance TypeError (PartialApplication +#if __GLASGOW_HASKELL__ >= 904 + @(Type -> [Type] -> Constraint) +#endif + HasServer arr) => HasServer ((arr :: a -> b) :> sub) context where type ServerT (arr :> sub) _ = TypeError (PartialApplication (HasServer :: * -> [*] -> Constraint) arr) route = error "unreachable" @@ -865,7 +872,11 @@ type HasServerArrowTypeError a b = -- XXX: This omits the @context@ parameter, e.g.: -- -- "There is no instance for HasServer (Bool :> …)". Do we care ? -instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub HasServer ty) => HasServer (ty :> sub) context +instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub +#if __GLASGOW_HASKELL__ >= 904 + @(Type -> [Type] -> Constraint) +#endif + HasServer ty) => HasServer (ty :> sub) context instance {-# OVERLAPPABLE #-} TypeError (NoInstanceFor (HasServer api context)) => HasServer api context diff --git a/servant/servant.cabal b/servant/servant.cabal index 32b63feb..6ea613ab 100644 --- a/servant/servant.cabal +++ b/servant/servant.cabal @@ -80,7 +80,7 @@ library -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends: - base >= 4.9 && < 4.17 + base >= 4.9 && < 4.18 , bytestring >= 0.10.8.1 && < 0.12 , constraints >= 0.2 , mtl >= 2.2.2 && < 2.3 @@ -92,7 +92,7 @@ library -- We depend (heavily) on the API of these packages: -- i.e. re-export, or allow using without direct dependency build-depends: - http-api-data >= 0.4.1 && < 0.4.4 + http-api-data >= 0.4.1 && < 0.5.1 , singleton-bool >= 0.1.4 && < 0.1.7 -- Other dependencies: Lower bound around what is in the latest Stackage LTS. diff --git a/servant/src/Servant/API/TypeLevel.hs b/servant/src/Servant/API/TypeLevel.hs index 4a5e3c3b..3a368907 100644 --- a/servant/src/Servant/API/TypeLevel.hs +++ b/servant/src/Servant/API/TypeLevel.hs @@ -110,7 +110,7 @@ type family IsElem' a s :: Constraint -- -- >>> ok (Proxy :: Proxy (IsElem ("bye" :> Get '[JSON] Int) SampleAPI)) -- ... --- ... Could not deduce... +-- ... Could not ... -- ... -- -- An endpoint is considered within an api even if it is missing combinators @@ -151,7 +151,7 @@ type family IsElem endpoint api :: Constraint where -- -- >>> ok (Proxy :: Proxy (IsSubAPI (SampleAPI :<|> Get '[JSON] Int) SampleAPI)) -- ... --- ... Could not deduce... +-- ... Could not ... -- ... -- -- This uses @IsElem@ for checking; thus the note there applies here. @@ -174,7 +174,7 @@ type family AllIsElem xs api :: Constraint where -- -- >>> ok (Proxy :: Proxy (IsIn (Get '[JSON] Int) (Header "h" Bool :> Get '[JSON] Int))) -- ... --- ... Could not deduce... +-- ... Could not ... -- ... type family IsIn (endpoint :: *) (api :: *) :: Constraint where IsIn e (sa :<|> sb) = Or (IsIn e sa) (IsIn e sb) diff --git a/servant/src/Servant/Links.hs b/servant/src/Servant/Links.hs index ce07e22d..74314e0a 100644 --- a/servant/src/Servant/Links.hs +++ b/servant/src/Servant/Links.hs @@ -1,5 +1,6 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} @@ -91,7 +92,7 @@ -- >>> let bad_link = Proxy :: Proxy ("hello" :> Delete '[JSON] NoContent) -- >>> safeLink api bad_link -- ... --- ...Could not deduce... +-- ...Could not ... -- ... -- -- This error is essentially saying that the type family couldn't find @@ -193,6 +194,8 @@ import Servant.API.Verbs import Servant.API.WithNamedContext (WithNamedContext) import Web.HttpApiData +import Data.Kind + (Type) -- | A safe link datatype. -- The only way of constructing a 'Link' is using 'safeLink', which means any @@ -647,12 +650,20 @@ simpleToLink _ toA _ = toLink toA (Proxy :: Proxy sub) -- >>> import Data.Text (Text) -- Erroring instance for 'HasLink' when a combinator is not fully applied -instance TypeError (PartialApplication HasLink arr) => HasLink ((arr :: a -> b) :> sub) +instance TypeError (PartialApplication +#if __GLASGOW_HASKELL__ >= 904 + @(Type -> Constraint) +#endif + HasLink arr) => HasLink ((arr :: a -> b) :> sub) where type MkLink (arr :> sub) _ = TypeError (PartialApplication (HasLink :: * -> Constraint) arr) toLink = error "unreachable" -- Erroring instances for 'HasLink' for unknown API combinators -instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub HasLink ty) => HasLink (ty :> sub) +instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub +#if __GLASGOW_HASKELL__ >= 904 + @(Type -> Constraint) +#endif + HasLink ty) => HasLink (ty :> sub) instance {-# OVERLAPPABLE #-} TypeError (NoInstanceFor (HasLink api)) => HasLink api