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 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'client/src') 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 -- cgit v1.2.3