on master help sign in
Merge pull request #1592 from TeofilC/ghc-9.4

Support GHC-9.4

commitd5b9cbf63480d249327db1ad0d5588b0988765d4 authorMaxim Koltsov <kolmax94@gmail.com> dateThu 27 Oct 2022, 22:14 (4 years ago) parente4650deff135e8
17 files changed+56−28
.github/workflows/master.yml+1 cabal.project+5 servant-auth/servant-auth-client/servant-auth-client.cabal+1−1 servant-auth/servant-auth-docs/servant-auth-docs.cabal+2−2 servant-auth/servant-auth-server/servant-auth-server.cabal+3−3 servant-auth/servant-auth-swagger/servant-auth-swagger.cabal+1−1 servant-auth/servant-auth/servant-auth.cabal+1−1 servant-client-core/servant-client-core.cabal+2−2 servant-client/servant-client.cabal+2−2 servant-docs/servant-docs.cabal+1−1 servant-foreign/servant-foreign.cabal+1−1 servant-http-streams/servant-http-streams.cabal+2−2 servant-server/servant-server.cabal+2−2 servant-server/src/Servant/Server/Internal.hs+13−2 servant/servant.cabal+2−2 servant/src/Servant/API/TypeLevel.hs+3−3 servant/src/Servant/Links.hs+14−3
.github/workflows/master.yml+1
@@ -20,6 +20,7 @@ jobs:
2020 - "8.10.7"
2121 - "9.0.2"
2222 - "9.2.2"
23+ - "9.4.2"
2324
2425 steps:
2526 - uses: actions/checkout@v2
cabal.project+5
@@ -51,3 +51,8 @@ packages:
5151tests: True
5252optimization: False
5353-- reorder-goals: True
54+
55+allow-newer:
56+-- see https://github.com/haskellari/postgresql-simple/issues/104
57+ postgresql-simple:base
58+ , postgresql-simple:template-haskell
servant-auth/servant-auth-client/servant-auth-client.cabal+1−1
@@ -31,7 +31,7 @@ library
3131 default-extensions: ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators
3232 ghc-options: -Wall
3333 build-depends:
34− base >= 4.10 && < 4.17
34+ base >= 4.10 && < 4.18
3535 , bytestring >= 0.10.6.0 && < 0.12
3636 , containers >= 0.5.6.2 && < 0.7
3737 , servant-auth == 0.4.*
servant-auth/servant-auth-docs/servant-auth-docs.cabal+2−2
@@ -35,7 +35,7 @@ library
3535 default-extensions: ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators
3636 ghc-options: -Wall
3737 build-depends:
38− base >= 4.10 && < 4.17
38+ base >= 4.10 && < 4.18
3939 , servant-docs >= 0.11.2 && < 0.13
4040 , servant >= 0.13 && < 0.20
4141 , servant-auth == 0.4.*
@@ -50,7 +50,7 @@ test-suite doctests
5050 build-depends:
5151 base,
5252 servant-auth-docs,
53− doctest >= 0.16 && < 0.19,
53+ doctest >= 0.16 && < 0.21,
5454 QuickCheck >= 2.11.3 && < 2.15,
5555 template-haskell
5656 ghc-options: -Wall -threaded
servant-auth/servant-auth-server/servant-auth-server.cabal+3−3
@@ -31,7 +31,7 @@ library
3131 default-extensions: ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators
3232 ghc-options: -Wall
3333 build-depends:
34− base >= 4.10 && < 4.17
34+ base >= 4.10 && < 4.18
3535 , aeson >= 1.0.0.1 && < 3
3636 , base64-bytestring >= 1.0.0.1 && < 2
3737 , blaze-builder >= 0.4.1.0 && < 0.5
@@ -43,7 +43,7 @@ library
4343 , http-types >= 0.12.2 && < 0.13
4444 , jose >= 0.7.0.0 && < 0.10
4545 , lens >= 4.16.1 && < 5.3
46− , memory >= 0.14.16 && < 0.18
46+ , memory >= 0.14.16 && < 0.19
4747 , monad-time >= 0.3.1.0 && < 0.4
4848 , mtl >= 2.2.2 && < 2.3
4949 , servant >= 0.13 && < 0.20
@@ -51,7 +51,7 @@ library
5151 , servant-server >= 0.13 && < 0.20
5252 , tagged >= 0.8.4 && < 0.9
5353 , text >= 1.2.3.0 && < 2.1
54− , time >= 1.5.0.1 && < 1.12
54+ , time >= 1.5.0.1 && < 1.13
5555 , unordered-containers >= 0.2.9.0 && < 0.3
5656 , wai >= 3.2.1.2 && < 3.3
5757
servant-auth/servant-auth-swagger/servant-auth-swagger.cabal+1−1
@@ -31,7 +31,7 @@ library
3131 default-extensions: ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators
3232 ghc-options: -Wall
3333 build-depends:
34− base >= 4.10 && < 4.17
34+ base >= 4.10 && < 4.18
3535 , text >= 1.2.3.0 && < 2.1
3636 , servant-swagger >= 1.1.5 && < 2
3737 , swagger2 >= 2.2.2 && < 3
servant-auth/servant-auth/servant-auth.cabal+1−1
@@ -33,7 +33,7 @@ library
3333 default-extensions: ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveTraversable FlexibleContexts FlexibleInstances FunctionalDependencies GADTs KindSignatures MultiParamTypeClasses OverloadedStrings RankNTypes ScopedTypeVariables TypeFamilies TypeOperators
3434 ghc-options: -Wall
3535 build-depends:
36− base >= 4.10 && < 4.17
36+ base >= 4.10 && < 4.18
3737 , containers >= 0.6 && < 0.7
3838 , aeson >= 1.3.1.1 && < 3
3939 , jose >= 0.7.0.0 && < 0.10
servant-client-core/servant-client-core.cabal+2−2
@@ -50,14 +50,14 @@ library
5050 --
5151 -- note: mtl lower bound is so low because of GHC-7.8
5252 build-depends:
53− base >= 4.9 && < 4.17
53+ base >= 4.9 && < 4.18
5454 , bytestring >= 0.10.8.1 && < 0.12
5555 , constraints >= 0.2 && < 0.14
5656 , containers >= 0.5.7.1 && < 0.7
5757 , deepseq >= 1.4.2.0 && < 1.5
5858 , text >= 1.2.3.0 && < 2.1
5959 , transformers >= 0.5.2.0 && < 0.6
60− , template-haskell >= 2.11.1.0 && < 2.19
60+ , template-haskell >= 2.11.1.0 && < 2.20
6161
6262 if !impl(ghc >= 8.2)
6363 build-depends:
servant-client/servant-client.cabal+2−2
@@ -41,14 +41,14 @@ library
4141 -- Bundled with GHC: Lower bound to not force re-installs
4242 -- text and mtl are bundled starting with GHC-8.4
4343 build-depends:
44− base >= 4.9 && < 4.17
44+ base >= 4.9 && < 4.18
4545 , bytestring >= 0.10.8.1 && < 0.12
4646 , containers >= 0.5.7.1 && < 0.7
4747 , deepseq >= 1.4.2.0 && < 1.5
4848 , mtl >= 2.2.2 && < 2.3
4949 , stm >= 2.4.5.1 && < 2.6
5050 , text >= 1.2.3.0 && < 2.1
51− , time >= 1.6.0.1 && < 1.12
51+ , time >= 1.6.0.1 && < 1.13
5252 , transformers >= 0.5.2.0 && < 0.6
5353
5454 if !impl(ghc >= 8.2)
servant-docs/servant-docs.cabal+1−1
@@ -41,7 +41,7 @@ library
4141 --
4242 -- note: mtl lower bound is so low because of GHC-7.8
4343 build-depends:
44− base >= 4.9 && < 4.17
44+ base >= 4.9 && < 4.18
4545 , bytestring >= 0.10.8.1 && < 0.12
4646 , text >= 1.2.3.0 && < 2.1
4747
servant-foreign/servant-foreign.cabal+1−1
@@ -41,7 +41,7 @@ library
4141 --
4242 -- note: mtl lower bound is so low because of GHC-7.8
4343 build-depends:
44− base >= 4.9 && < 4.17
44+ base >= 4.9 && < 4.18
4545 , text >= 1.2.3.0 && < 2.1
4646
4747 -- Servant dependencies
servant-http-streams/servant-http-streams.cabal+2−2
@@ -38,13 +38,13 @@ library
3838 -- Bundled with GHC: Lower bound to not force re-installs
3939 -- text and mtl are bundled starting with GHC-8.4
4040 build-depends:
41− base >= 4.9 && < 4.17
41+ base >= 4.9 && < 4.18
4242 , bytestring >= 0.10.8.1 && < 0.12
4343 , containers >= 0.5.7.1 && < 0.7
4444 , deepseq >= 1.4.2.0 && < 1.5
4545 , mtl >= 2.2.2 && < 2.3
4646 , text >= 1.2.3.0 && < 2.1
47− , time >= 1.6.0.1 && < 1.12
47+ , time >= 1.6.0.1 && < 1.13
4848 , transformers >= 0.5.2.0 && < 0.6
4949
5050 if !impl(ghc >= 8.2)
servant-server/servant-server.cabal+2−2
@@ -60,7 +60,7 @@ library
6060 -- Bundled with GHC: Lower bound to not force re-installs
6161 -- text and mtl are bundled starting with GHC-8.4
6262 build-depends:
63− base >= 4.9 && < 4.17
63+ base >= 4.9 && < 4.18
6464 , bytestring >= 0.10.8.1 && < 0.12
6565 , constraints >= 0.2 && < 0.14
6666 , containers >= 0.5.7.1 && < 0.7
@@ -73,7 +73,7 @@ library
7373 -- strict dependency as we re-export 'servant' things.
7474 build-depends:
7575 servant >= 0.19 && < 0.20
76− , http-api-data >= 0.4.1 && < 0.4.4
76+ , http-api-data >= 0.4.1 && < 0.5.1
7777
7878 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
7979 -- Here can be exceptions if we really need features from the newer versions.
servant-server/src/Servant/Server/Internal.hs+13−2
@@ -1,5 +1,6 @@
11{-# LANGUAGE AllowAmbiguousTypes #-}
22{-# LANGUAGE ConstraintKinds #-}
3+{-# LANGUAGE CPP #-}
34{-# LANGUAGE DataKinds #-}
45{-# LANGUAGE DeriveDataTypeable #-}
56{-# LANGUAGE FlexibleContexts #-}
@@ -94,6 +95,8 @@ import Servant.API.TypeErrors
9495import Web.HttpApiData
9596 (FromHttpApiData, parseHeader, parseQueryParam, parseUrlPiece,
9697 parseUrlPieces)
98+import Data.Kind
99+ (Type)
97100
98101import Servant.Server.Internal.BasicAuth
99102import Servant.Server.Internal.Context
@@ -821,7 +824,11 @@ instance (HasContextEntry context (NamedContext name subContext), HasServer subA
821824-------------------------------------------------------------------------------
822825
823826-- Erroring instance for 'HasServer' when a combinator is not fully applied
824−instance TypeError (PartialApplication HasServer arr) => HasServer ((arr :: a -> b) :> sub) context
827+instance TypeError (PartialApplication
828+#if __GLASGOW_HASKELL__ >= 904
829+ @(Type -> [Type] -> Constraint)
830+#endif
831+ HasServer arr) => HasServer ((arr :: a -> b) :> sub) context
825832 where
826833 type ServerT (arr :> sub) _ = TypeError (PartialApplication (HasServer :: * -> [*] -> Constraint) arr)
827834 route = error "unreachable"
@@ -865,7 +872,11 @@ type HasServerArrowTypeError a b =
865872-- XXX: This omits the @context@ parameter, e.g.:
866873--
867874-- "There is no instance for HasServer (Bool :> …)". Do we care ?
868−instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub HasServer ty) => HasServer (ty :> sub) context
875+instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub
876+#if __GLASGOW_HASKELL__ >= 904
877+ @(Type -> [Type] -> Constraint)
878+#endif
879+ HasServer ty) => HasServer (ty :> sub) context
869880
870881instance {-# OVERLAPPABLE #-} TypeError (NoInstanceFor (HasServer api context)) => HasServer api context
871882
servant/servant.cabal+2−2
@@ -80,7 +80,7 @@ library
8080 --
8181 -- note: mtl lower bound is so low because of GHC-7.8
8282 build-depends:
83− base >= 4.9 && < 4.17
83+ base >= 4.9 && < 4.18
8484 , bytestring >= 0.10.8.1 && < 0.12
8585 , constraints >= 0.2
8686 , mtl >= 2.2.2 && < 2.3
@@ -92,7 +92,7 @@ library
9292 -- We depend (heavily) on the API of these packages:
9393 -- i.e. re-export, or allow using without direct dependency
9494 build-depends:
95− http-api-data >= 0.4.1 && < 0.4.4
95+ http-api-data >= 0.4.1 && < 0.5.1
9696 , singleton-bool >= 0.1.4 && < 0.1.7
9797
9898 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
servant/src/Servant/API/TypeLevel.hs+3−3
@@ -110,7 +110,7 @@ type family IsElem' a s :: Constraint
110110--
111111-- >>> ok (Proxy :: Proxy (IsElem ("bye" :> Get '[JSON] Int) SampleAPI))
112112-- ...
113−-- ... Could not deduce...
113+-- ... Could not ...
114114-- ...
115115--
116116-- An endpoint is considered within an api even if it is missing combinators
@@ -151,7 +151,7 @@ type family IsElem endpoint api :: Constraint where
151151--
152152-- >>> ok (Proxy :: Proxy (IsSubAPI (SampleAPI :<|> Get '[JSON] Int) SampleAPI))
153153-- ...
154−-- ... Could not deduce...
154+-- ... Could not ...
155155-- ...
156156--
157157-- This uses @IsElem@ for checking; thus the note there applies here.
@@ -174,7 +174,7 @@ type family AllIsElem xs api :: Constraint where
174174--
175175-- >>> ok (Proxy :: Proxy (IsIn (Get '[JSON] Int) (Header "h" Bool :> Get '[JSON] Int)))
176176-- ...
177−-- ... Could not deduce...
177+-- ... Could not ...
178178-- ...
179179type family IsIn (endpoint :: *) (api :: *) :: Constraint where
180180 IsIn e (sa :<|> sb) = Or (IsIn e sa) (IsIn e sb)
servant/src/Servant/Links.hs+14−3
@@ -1,5 +1,6 @@
11{-# LANGUAGE AllowAmbiguousTypes #-}
22{-# LANGUAGE ConstraintKinds #-}
3+{-# LANGUAGE CPP #-}
34{-# LANGUAGE DataKinds #-}
45{-# LANGUAGE FlexibleContexts #-}
56{-# LANGUAGE FlexibleInstances #-}
@@ -91,7 +92,7 @@
9192-- >>> let bad_link = Proxy :: Proxy ("hello" :> Delete '[JSON] NoContent)
9293-- >>> safeLink api bad_link
9394-- ...
94−-- ...Could not deduce...
95+-- ...Could not ...
9596-- ...
9697--
9798-- This error is essentially saying that the type family couldn't find
@@ -193,6 +194,8 @@ import Servant.API.Verbs
193194import Servant.API.WithNamedContext
194195 (WithNamedContext)
195196import Web.HttpApiData
197+import Data.Kind
198+ (Type)
196199
197200-- | A safe link datatype.
198201-- The only way of constructing a 'Link' is using 'safeLink', which means any
@@ -647,12 +650,20 @@ simpleToLink _ toA _ = toLink toA (Proxy :: Proxy sub)
647650-- >>> import Data.Text (Text)
648651
649652-- Erroring instance for 'HasLink' when a combinator is not fully applied
650−instance TypeError (PartialApplication HasLink arr) => HasLink ((arr :: a -> b) :> sub)
653+instance TypeError (PartialApplication
654+#if __GLASGOW_HASKELL__ >= 904
655+ @(Type -> Constraint)
656+#endif
657+ HasLink arr) => HasLink ((arr :: a -> b) :> sub)
651658 where
652659 type MkLink (arr :> sub) _ = TypeError (PartialApplication (HasLink :: * -> Constraint) arr)
653660 toLink = error "unreachable"
654661
655662-- Erroring instances for 'HasLink' for unknown API combinators
656−instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub HasLink ty) => HasLink (ty :> sub)
663+instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub
664+#if __GLASGOW_HASKELL__ >= 904
665+ @(Type -> Constraint)
666+#endif
667+ HasLink ty) => HasLink (ty :> sub)
657668
658669instance {-# OVERLAPPABLE #-} TypeError (NoInstanceFor (HasLink api)) => HasLink api