git.iko.soy/typeable/servant
on master help sign in
Ghc 8.2 fixes
commit39ad4656956eb7ffd4f192965a2d6844495df629 authorJulian K. Arni <jkarni@gmail.com> dateThu 14 Sep 2017, 09:53 (9 years ago) parentda83378
6 files changed+18−13
servant-client-core/servant-client-core.cabal+5−2 servant-client-core/src/Servant/Client/Core/Internal/HasClient.hs+2−2 servant-client-core/src/Servant/Client/Core/Internal/RunClient.hs+7−4 servant-client/servant-client.cabal+1−4 servant/servant.cabal+2 stack-ghc-8.2.1.yaml+1−1
servant-client-core/servant-client-core.cabal+5−2
@@ -44,11 +44,14 @@ library
4444 , http-api-data >= 0.3.6 && < 0.4
4545 , http-media >= 0.6.2 && < 0.8
4646 , http-types >= 0.8.6 && < 0.10
47− , mtl >= 2.2 && < 2.3
47+ , mtl >= 2.1 && < 2.3
4848 , network-uri >= 2.6 && < 2.7
4949 , safe >= 0.3.9 && < 0.4
5050 , servant == 0.11.*
5151 , text >= 1.2 && < 1.3
52+ if !impl(ghc >= 8.0)
53+ build-depends:
54+ semigroups >=0.16.2.2 && <0.19
5255 hs-source-dirs: src
5356 default-language: Haskell2010
5457 ghc-options: -Wall
@@ -66,6 +69,6 @@ test-suite spec
6669 , deepseq
6770 , servant-client-core
6871 , hspec == 2.*
69− , QuickCheck >= 2.7 && < 2.10
72+ , QuickCheck >= 2.7 && < 2.11
7073 other-modules:
7174 Servant.Client.Core.Internal.BaseUrlSpec
servant-client-core/src/Servant/Client/Core/Internal/HasClient.hs+2−2
@@ -14,6 +14,8 @@
1414#include "overlapping-compat.h"
1515module Servant.Client.Core.Internal.HasClient where
1616
17+import Prelude.Compat
18+import Prelude ()
1719
1820import Control.Monad.Error.Class (throwError)
1921import Data.List (foldl')
@@ -23,8 +25,6 @@ import Data.Text (pack)
2325import GHC.Exts (fromList, toList)
2426import GHC.TypeLits (KnownSymbol, symbolVal)
2527import qualified Network.HTTP.Types as H
26−import Prelude ()
27−import Prelude.Compat
2828import Servant.API ((:<|>) ((:<|>)), (:>),
2929 AuthProtect, BasicAuth,
3030 BasicAuthData,
servant-client-core/src/Servant/Client/Core/Internal/RunClient.hs+7−4
@@ -1,13 +1,17 @@
11{-# LANGUAGE FlexibleContexts #-}
22{-# LANGUAGE MultiParamTypeClasses #-}
3+{-# LANGUAGE OverloadedStrings #-}
34{-# LANGUAGE ScopedTypeVariables #-}
45{-# LANGUAGE TypeFamilies #-}
5−{-# LANGUAGE OverloadedStrings #-}
66-- | Types for possible backends to run client-side `Request` queries
77module Servant.Client.Core.Internal.RunClient where
88
9+import Prelude.Compat
10+import Prelude ()
11+
912import Control.Monad (unless)
1013import Control.Monad.Error.Class (MonadError, throwError)
14+import Data.Foldable (toList)
1115import Data.Proxy (Proxy)
1216import qualified Data.Text as T
1317import Network.HTTP.Media (MediaType, matches,
@@ -17,7 +21,6 @@ import Servant.API (MimeUnrender,
1721 mimeUnrender)
1822import Servant.Client.Core.Internal.Request (Request, Response (..),
1923 ServantError (..))
20−import Data.Foldable (toList)
2124
2225class (MonadError ServantError m) => RunClient m where
2326 -- | How to make a request.
@@ -26,10 +29,10 @@ class (MonadError ServantError m) => RunClient m where
2629checkContentTypeHeader :: RunClient m => Response -> m MediaType
2730checkContentTypeHeader response =
2831 case lookup "Content-Type" $ toList $ responseHeaders response of
29− Nothing -> pure $ "application"//"octet-stream"
32+ Nothing -> return $ "application"//"octet-stream"
3033 Just t -> case parseAccept t of
3134 Nothing -> throwError $ InvalidContentTypeHeader response
32− Just t' -> pure t'
35+ Just t' -> return t'
3336
3437decodedAs :: forall ct a m. (MimeUnrender ct a, RunClient m)
3538 => Response -> Proxy ct -> m a
servant-client/servant-client.cabal+1−4
@@ -43,16 +43,13 @@ library
4343 , http-types >= 0.8.6 && < 0.10
4444 , exceptions >= 0.8 && < 0.9
4545 , monad-control >= 1.0.0.4 && < 1.1
46− , mtl >= 2.2 && < 2.3
46+ , mtl >= 2.1 && < 2.3
4747 , semigroupoids >= 4.3 && < 5.3
4848 , servant-client-core == 0.11.*
4949 , text >= 1.2 && < 1.3
5050 , transformers >= 0.3 && < 0.6
5151 , transformers-base >= 0.4.4 && < 0.5
5252 , transformers-compat >= 0.4 && < 0.6
53− if !impl(ghc >= 8.0)
54− build-depends:
55− semigroups >=0.16.2.2 && <0.19
5653 hs-source-dirs: src
5754 default-language: Haskell2010
5855 ghc-options: -Wall
servant/servant.cabal+2
@@ -155,3 +155,5 @@ test-suite doctests
155155 include-dirs: include
156156 x-doctest-source-dirs: test
157157 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
22packages:
33- servant-client/
44- servant-client-core/