From d9a9f63d4bc32ea9b5896b2a9c64eb5f8047eba4 Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Sun, 4 Sep 2016 11:16:48 +0200 Subject: [PATCH] compiles now with 'stack build --pedantic' --- doc/tutorial/Client.lhs | 3 +-- servant-client/src/Servant/Client.hs | 3 +-- servant-client/src/Servant/Common/Req.hs | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/tutorial/Client.lhs b/doc/tutorial/Client.lhs index e7543ddb..fa825e2c 100644 --- a/doc/tutorial/Client.lhs +++ b/doc/tutorial/Client.lhs @@ -15,11 +15,10 @@ need to have some language extensions and imports: module Client where -import Control.Monad.Trans.Except (ExceptT, runExceptT) import Data.Aeson import Data.Proxy import GHC.Generics -import Network.HTTP.Client (Manager, newManager, defaultManagerSettings) +import Network.HTTP.Client (newManager, defaultManagerSettings) import Servant.API import Servant.Client ``` diff --git a/servant-client/src/Servant/Client.hs b/servant-client/src/Servant/Client.hs index 87b819b2..0b7bdeac 100644 --- a/servant-client/src/Servant/Client.hs +++ b/servant-client/src/Servant/Client.hs @@ -30,14 +30,13 @@ module Servant.Client #if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) #endif -import Control.Monad.Reader (ask) import Data.ByteString.Lazy (ByteString) import Data.List import Data.Proxy import Data.String.Conversions import Data.Text (unpack) import GHC.TypeLits -import Network.HTTP.Client (Manager, Response) +import Network.HTTP.Client (Response) import Network.HTTP.Media import qualified Network.HTTP.Types as H import qualified Network.HTTP.Types.Header as HTTP diff --git a/servant-client/src/Servant/Common/Req.hs b/servant-client/src/Servant/Common/Req.hs index 447a20a3..425ef966 100644 --- a/servant-client/src/Servant/Common/Req.hs +++ b/servant-client/src/Servant/Common/Req.hs @@ -175,13 +175,13 @@ performRequest :: Method -> Req -> ClientM ( Int, ByteString, MediaType , [HTTP.Header], Response ByteString) performRequest reqMethod req = do - manager <- asks manager + m <- asks manager reqHost <- asks baseUrl partialRequest <- liftIO $ reqToRequest req reqHost let request = partialRequest { Client.method = reqMethod } - eResponse <- liftIO $ catchConnectionError $ Client.httpLbs request manager + eResponse <- liftIO $ catchConnectionError $ Client.httpLbs request m case eResponse of Left err -> throwError . ConnectionError $ SomeException err