diff options
Diffstat (limited to 'client')
| -rw-r--r-- | client/src/Thermoprint/Client.hs | 11 | ||||
| -rw-r--r-- | client/thermoprint-client.cabal | 4 | 
2 files changed, 9 insertions, 6 deletions
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 | |||
| 17 | -- = Reexports | 17 | -- = Reexports | 
| 18 | , ServantError(..) | 18 | , ServantError(..) | 
| 19 | , module Thermoprint.API | 19 | , module Thermoprint.API | 
| 20 | , module Servant.Common.BaseUrl | 20 | , module Servant.Client | 
| 21 | , module Control.Monad.Except | 21 | , module Control.Monad.Except | 
| 22 | , module Control.Natural | 22 | , module Control.Natural | 
| 23 | ) where | 23 | ) where | 
| @@ -27,10 +27,8 @@ import Data.Map (Map) | |||
| 27 | import Data.Sequence (Seq) | 27 | import Data.Sequence (Seq) | 
| 28 | import Data.Time (UTCTime) | 28 | import Data.Time (UTCTime) | 
| 29 | 29 | ||
| 30 | import Servant.Client hiding (HasClient(..)) | 30 | import Servant.Client hiding (HasClient(..), mkClient) | 
| 31 | import qualified Servant.Client as S | 31 | import qualified Servant.Client as S | 
| 32 | import Servant.Common.BaseUrl | ||
| 33 | import Servant.Common.Req | ||
| 34 | import Network.HTTP.Client (Manager, ManagerSettings, newManager, defaultManagerSettings) | 32 | import Network.HTTP.Client (Manager, ManagerSettings, newManager, defaultManagerSettings) | 
| 35 | import Servant.API | 33 | import Servant.API | 
| 36 | -- import Servant.Utils.Enter | 34 | -- import Servant.Utils.Enter | 
| @@ -42,6 +40,8 @@ import Control.Monad.Catch (Exception, MonadThrow(..)) | |||
| 42 | import Control.Monad.IO.Class (MonadIO(..)) | 40 | import Control.Monad.IO.Class (MonadIO(..)) | 
| 43 | import Control.Monad.Trans (lift) | 41 | import Control.Monad.Trans (lift) | 
| 44 | 42 | ||
| 43 | import Control.Concurrent.STM.TVar (newTVarIO) | ||
| 44 | |||
| 45 | import Control.Monad | 45 | import Control.Monad | 
| 46 | import Control.Category | 46 | import Control.Category | 
| 47 | import Prelude hiding (id, (.)) | 47 | import Prelude hiding (id, (.)) | 
| @@ -128,7 +128,8 @@ mkClient mSettings url = mkClientS clientNat | |||
| 128 | clientNat :: forall m. (MonadThrow m, MonadIO m) => ClientM :~> m | 128 | clientNat :: forall m. (MonadThrow m, MonadIO m) => ClientM :~> m | 
| 129 | clientNat = NT $ \cAct -> do | 129 | clientNat = NT $ \cAct -> do | 
| 130 | mgr <- liftIO $ newManager mSettings | 130 | mgr <- liftIO $ newManager mSettings | 
| 131 | either throwM return =<< liftIO (runClientM cAct $ ClientEnv mgr url) | 131 | cjar <- liftIO $ newTVarIO mempty | 
| 132 | either throwM return =<< liftIO (runClientM cAct . ClientEnv mgr url $ Just cjar) | ||
| 132 | 133 | ||
| 133 | mkClient' :: (MonadThrow m, MonadIO m) => BaseUrl -> Client m | 134 | mkClient' :: (MonadThrow m, MonadIO m) => BaseUrl -> Client m | 
| 134 | -- ^ @mkClient' = mkClient defaultManagerSettings | 135 | -- ^ @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 | |||
| 24 | , thermoprint-spec ==6.0.* | 24 | , thermoprint-spec ==6.0.* | 
| 25 | , servant >=0.4.4 && <1 | 25 | , servant >=0.4.4 && <1 | 
| 26 | , servant-client >=0.4.4 && <1 | 26 | , servant-client >=0.4.4 && <1 | 
| 27 | , servant-client-core >=0.13 && <1 | ||
| 27 | , servant-server >=0.4.4 && <1 | 28 | , servant-server >=0.4.4 && <1 | 
| 28 | , containers >=0.5.6 && <1 | 29 | , containers >=0.5.6 && <1 | 
| 29 | , either >=4.4.1 && <5 | 30 | , either >=4.4.1 && <6 | 
| 30 | , time >=1.5.0 && <2 | 31 | , time >=1.5.0 && <2 | 
| 31 | , exceptions >=0.8.2 && <1 | 32 | , exceptions >=0.8.2 && <1 | 
| 32 | , transformers >=0.4.2 && <1 | 33 | , transformers >=0.4.2 && <1 | 
| 33 | , http-client >=0.4.28 && <1 | 34 | , http-client >=0.4.28 && <1 | 
| 34 | , mtl >=2.2.1 && <3 | 35 | , mtl >=2.2.1 && <3 | 
| 35 | , natural-transformation >=0.4 && <1 | 36 | , natural-transformation >=0.4 && <1 | 
| 37 | , stm >=2.4 && <3 | ||
| 36 | hs-source-dirs: src | 38 | hs-source-dirs: src | 
| 37 | default-language: Haskell2010 | 39 | default-language: Haskell2010 | 
| 38 | ghc-options: -Wall | 40 | ghc-options: -Wall | 
