git.iko.soy/typeable/servant
on master help sign in
Ghc 8.2 fixes
39ad465Julian K. Arni
servant-client-core/servant-client-core.cabal+5−2
@@ -44,11 +44,14 @@ library
44 , http-api-data >= 0.3.6 && < 0.4
44 , http-api-data >= 0.3.6 && < 0.4
45 , http-media >= 0.6.2 && < 0.8
45 , http-media >= 0.6.2 && < 0.8
46 , http-types >= 0.8.6 && < 0.10
46 , http-types >= 0.8.6 && < 0.10
47− , mtl >= 2.2 && < 2.3
47+ , mtl >= 2.1 && < 2.3
48 , network-uri >= 2.6 && < 2.7
48 , network-uri >= 2.6 && < 2.7
49 , safe >= 0.3.9 && < 0.4
49 , safe >= 0.3.9 && < 0.4
50 , servant == 0.11.*
50 , servant == 0.11.*
51 , text >= 1.2 && < 1.3
51 , text >= 1.2 && < 1.3
52+ if !impl(ghc >= 8.0)
53+ build-depends:
54+ semigroups >=0.16.2.2 && <0.19
52 hs-source-dirs: src
55 hs-source-dirs: src
53 default-language: Haskell2010
56 default-language: Haskell2010
54 ghc-options: -Wall
57 ghc-options: -Wall
@@ -66,6 +69,6 @@ test-suite spec
66 , deepseq
69 , deepseq
67 , servant-client-core
70 , servant-client-core
68 , hspec == 2.*
71 , hspec == 2.*
69− , QuickCheck >= 2.7 && < 2.10
72+ , QuickCheck >= 2.7 && < 2.11
70 other-modules:
73 other-modules:
71 Servant.Client.Core.Internal.BaseUrlSpec
74 Servant.Client.Core.Internal.BaseUrlSpec
servant-client-core/src/Servant/Client/Core/Internal/HasClient.hs+2−2
@@ -14,6 +14,8 @@
14#include "overlapping-compat.h"
14#include "overlapping-compat.h"
15module Servant.Client.Core.Internal.HasClient where
15module Servant.Client.Core.Internal.HasClient where
16
16
17+import Prelude.Compat
18+import Prelude ()
17
19
18import Control.Monad.Error.Class (throwError)
20import Control.Monad.Error.Class (throwError)
19import Data.List (foldl')
21import Data.List (foldl')
@@ -23,8 +25,6 @@ import Data.Text (pack)
23import GHC.Exts (fromList, toList)
25import GHC.Exts (fromList, toList)
24import GHC.TypeLits (KnownSymbol, symbolVal)
26import GHC.TypeLits (KnownSymbol, symbolVal)
25import qualified Network.HTTP.Types as H
27import qualified Network.HTTP.Types as H
26−import Prelude ()
27−import Prelude.Compat
28import Servant.API ((:<|>) ((:<|>)), (:>),
28import Servant.API ((:<|>) ((:<|>)), (:>),
29 AuthProtect, BasicAuth,
29 AuthProtect, BasicAuth,
30 BasicAuthData,
30 BasicAuthData,
servant-client-core/src/Servant/Client/Core/Internal/RunClient.hs+7−4
@@ -1,13 +1,17 @@
1{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE MultiParamTypeClasses #-}
2{-# LANGUAGE MultiParamTypeClasses #-}
3+{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE ScopedTypeVariables #-}
4{-# LANGUAGE ScopedTypeVariables #-}
4{-# LANGUAGE TypeFamilies #-}
5{-# LANGUAGE TypeFamilies #-}
5−{-# LANGUAGE OverloadedStrings #-}
6-- | Types for possible backends to run client-side `Request` queries
6-- | Types for possible backends to run client-side `Request` queries
7module Servant.Client.Core.Internal.RunClient where
7module Servant.Client.Core.Internal.RunClient where
8
8
9+import Prelude.Compat
10+import Prelude ()
11+
9import Control.Monad (unless)
12import Control.Monad (unless)
10import Control.Monad.Error.Class (MonadError, throwError)
13import Control.Monad.Error.Class (MonadError, throwError)
14+import Data.Foldable (toList)
11import Data.Proxy (Proxy)
15import Data.Proxy (Proxy)
12import qualified Data.Text as T
16import qualified Data.Text as T
13import Network.HTTP.Media (MediaType, matches,
17import Network.HTTP.Media (MediaType, matches,
@@ -17,7 +21,6 @@ import Servant.API (MimeUnrender,
17 mimeUnrender)
21 mimeUnrender)
18import Servant.Client.Core.Internal.Request (Request, Response (..),
22import Servant.Client.Core.Internal.Request (Request, Response (..),
19 ServantError (..))
23 ServantError (..))
20−import Data.Foldable (toList)
21
24
22class (MonadError ServantError m) => RunClient m where
25class (MonadError ServantError m) => RunClient m where
23 -- | How to make a request.
26 -- | How to make a request.
@@ -26,10 +29,10 @@ class (MonadError ServantError m) => RunClient m where
26checkContentTypeHeader :: RunClient m => Response -> m MediaType
29checkContentTypeHeader :: RunClient m => Response -> m MediaType
27checkContentTypeHeader response =
30checkContentTypeHeader response =
28 case lookup "Content-Type" $ toList $ responseHeaders response of
31 case lookup "Content-Type" $ toList $ responseHeaders response of
29− Nothing -> pure $ "application"//"octet-stream"
32+ Nothing -> return $ "application"//"octet-stream"
30 Just t -> case parseAccept t of
33 Just t -> case parseAccept t of
31 Nothing -> throwError $ InvalidContentTypeHeader response
34 Nothing -> throwError $ InvalidContentTypeHeader response
32− Just t' -> pure t'
35+ Just t' -> return t'
33
36
34decodedAs :: forall ct a m. (MimeUnrender ct a, RunClient m)
37decodedAs :: forall ct a m. (MimeUnrender ct a, RunClient m)
35 => Response -> Proxy ct -> m a
38 => Response -> Proxy ct -> m a
servant-client/servant-client.cabal+1−4
@@ -43,16 +43,13 @@ library
43 , http-types >= 0.8.6 && < 0.10
43 , http-types >= 0.8.6 && < 0.10
44 , exceptions >= 0.8 && < 0.9
44 , exceptions >= 0.8 && < 0.9
45 , monad-control >= 1.0.0.4 && < 1.1
45 , monad-control >= 1.0.0.4 && < 1.1
46− , mtl >= 2.2 && < 2.3
46+ , mtl >= 2.1 && < 2.3
47 , semigroupoids >= 4.3 && < 5.3
47 , semigroupoids >= 4.3 && < 5.3
48 , servant-client-core == 0.11.*
48 , servant-client-core == 0.11.*
49 , text >= 1.2 && < 1.3
49 , text >= 1.2 && < 1.3
50 , transformers >= 0.3 && < 0.6
50 , transformers >= 0.3 && < 0.6
51 , transformers-base >= 0.4.4 && < 0.5
51 , transformers-base >= 0.4.4 && < 0.5
52 , transformers-compat >= 0.4 && < 0.6
52 , transformers-compat >= 0.4 && < 0.6
53− if !impl(ghc >= 8.0)
54− build-depends:
55− semigroups >=0.16.2.2 && <0.19
56 hs-source-dirs: src
53 hs-source-dirs: src
57 default-language: Haskell2010
54 default-language: Haskell2010
58 ghc-options: -Wall
55 ghc-options: -Wall
servant/servant.cabal+2
@@ -155,3 +155,5 @@ test-suite doctests
155 include-dirs: include
155 include-dirs: include
156 x-doctest-source-dirs: test
156 x-doctest-source-dirs: test
157 x-doctest-modules: Servant.Utils.LinksSpec
157 x-doctest-modules: Servant.Utils.LinksSpec
158+ other-modules:
159+ Build_doctests
stack-ghc-8.2.1.yaml+1−1
@@ -1,4 +1,4 @@
1−resolver: nightly-2017-09-01
1+resolver: nightly-2017-09-13
2packages:
2packages:
3- servant-client/
3- servant-client/
4- servant-client-core/
4- servant-client-core/