From e8e0cb7f36641ffb7901178bc54fef98eba9215c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 12 Apr 2018 14:34:05 +0200 Subject: Fix build --- client/src/Thermoprint/Client.hs | 11 ++++++----- client/thermoprint-client.cabal | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'client') diff --git a/client/src/Thermoprint/Client.hs b/client/src/Thermoprint/Client.hs index 8c4d99d..bb38268 100644 --- a/client/src/Thermoprint/Client.hs +++ b/client/src/Thermoprint/Client.hs @@ -17,7 +17,7 @@ module Thermoprint.Client -- = Reexports , ServantError(..) , module Thermoprint.API - , module Servant.Common.BaseUrl + , module Servant.Client , module Control.Monad.Except , module Control.Natural ) where @@ -27,10 +27,8 @@ import Data.Map (Map) import Data.Sequence (Seq) import Data.Time (UTCTime) -import Servant.Client hiding (HasClient(..)) +import Servant.Client hiding (HasClient(..), mkClient) import qualified Servant.Client as S -import Servant.Common.BaseUrl -import Servant.Common.Req import Network.HTTP.Client (Manager, ManagerSettings, newManager, defaultManagerSettings) import Servant.API -- import Servant.Utils.Enter @@ -42,6 +40,8 @@ import Control.Monad.Catch (Exception, MonadThrow(..)) import Control.Monad.IO.Class (MonadIO(..)) import Control.Monad.Trans (lift) +import Control.Concurrent.STM.TVar (newTVarIO) + import Control.Monad import Control.Category import Prelude hiding (id, (.)) @@ -128,7 +128,8 @@ mkClient mSettings url = mkClientS clientNat clientNat :: forall m. (MonadThrow m, MonadIO m) => ClientM :~> m clientNat = NT $ \cAct -> do mgr <- liftIO $ newManager mSettings - either throwM return =<< liftIO (runClientM cAct $ ClientEnv mgr url) + cjar <- liftIO $ newTVarIO mempty + either throwM return =<< liftIO (runClientM cAct . ClientEnv mgr url $ Just cjar) mkClient' :: (MonadThrow m, MonadIO m) => BaseUrl -> Client m -- ^ @mkClient' = mkClient defaultManagerSettings diff --git a/client/thermoprint-client.cabal b/client/thermoprint-client.cabal index 523b755..98fa962 100644 --- a/client/thermoprint-client.cabal +++ b/client/thermoprint-client.cabal @@ -24,15 +24,17 @@ library , thermoprint-spec ==6.0.* , servant >=0.4.4 && <1 , servant-client >=0.4.4 && <1 + , servant-client-core >=0.13 && <1 , servant-server >=0.4.4 && <1 , containers >=0.5.6 && <1 - , either >=4.4.1 && <5 + , either >=4.4.1 && <6 , time >=1.5.0 && <2 , exceptions >=0.8.2 && <1 , transformers >=0.4.2 && <1 , http-client >=0.4.28 && <1 , mtl >=2.2.1 && <3 , natural-transformation >=0.4 && <1 + , stm >=2.4 && <3 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall -- cgit v1.2.3