packages feed

rest-client 0.4.0.5 → 0.5.0.0

raw patch · 3 files changed

+27/−16 lines, 3 filesdep +exceptionsdep +transformersdep +transformers-compatdep −exception-transformersdep ~monad-controldep ~resourcetdep ~rest-typesPVP ok

version bump matches the API change (PVP)

Dependencies added: exceptions, transformers, transformers-compat

Dependencies removed: exception-transformers

Dependency ranges changed: monad-control, resourcet, rest-types, transformers-base

API changes (from Hackage documentation)

- Rest.Client.Base: instance (MonadException m, MonadBaseControl IO m) => MonadException (ApiT m)
- Rest.Client.Base: instance (MonadException m, MonadBaseControl IO m) => MonadException (ResourceT m)
+ Rest.Client.Base: instance ApiStateC m => ApiStateC (ExceptT e m)
+ Rest.Client.Base: instance MonadCatch m => MonadCatch (ApiT m)

Files

CHANGELOG.md view
@@ -1,5 +1,14 @@ # Changelog +#### 0.5.0.0++* Add `ApiStateC ExceptT` instance++* Add `MonadCatch ApiT` instance.++* Remove dependency on `exception-transformers` and drop `MonadException` instances. Use `MonadCatch` and `MonadThrow` instead.++ #### 0.4.0.5  * Allow `aeson-utils 0.3.*`
rest-client.cabal view
@@ -1,5 +1,5 @@ name:                rest-client-version:             0.4.0.5+version:             0.5.0.0 description:         Utility library for use in generated API client libraries. synopsis:            Utility library for use in generated API client libraries. maintainer:          code@silk.co@@ -29,17 +29,19 @@     , bytestring >= 0.9 && < 0.11     , case-insensitive >= 0.4 && < 1.3     , data-default == 0.5.*-    , exception-transformers == 0.3.*+    , exceptions == 0.8.*     , http-conduit == 2.1.*     , http-types >= 0.7 && < 0.9     , hxt >= 9.2 && < 9.4     , hxt-pickle-utils == 0.1.*-    , monad-control >= 0.3 && < 1.1+    , monad-control (>= 0.3.3.1 && < 0.4) || (>= 1.0.0.3 && < 1.1)     , mtl >= 2.0 && < 2.3     , primitive == 0.5.*-    , resourcet == 1.1.*-    , rest-types >= 1.11 && < 1.13+    , resourcet >= 1.1.4 && < 1.2+    , rest-types == 1.13.*     , tostring == 0.2.*-    , transformers-base == 0.4.*+    , transformers >= 0.3 && < 0.5+    , transformers-base >= 0.4.4 && < 0.5+    , transformers-compat >= 0.3 && < 0.5     , uri-encode == 1.5.*     , utf8-string >= 0.3 && < 1.1
src/Rest/Client/Base.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fno-warn-orphans #-}+{-# OPTIONS -fno-warn-orphans -fno-warn-deprecations #-} {-# LANGUAGE     CPP   , FlexibleContexts@@ -27,15 +27,16 @@  import Control.Applicative import Control.Monad.Base+import Control.Monad.Catch (MonadCatch (catch)) import Control.Monad.Cont hiding (mapM) import Control.Monad.Error hiding (mapM)-import Control.Monad.Exception import Control.Monad.List hiding (mapM) import Control.Monad.Primitive (PrimMonad) import Control.Monad.RWS hiding (mapM) import Control.Monad.Reader hiding (mapM) import Control.Monad.State hiding (mapM) import Control.Monad.Trans.Control+import Control.Monad.Trans.Except (ExceptT) import Control.Monad.Trans.Resource import Control.Monad.Writer hiding (mapM) import Data.ByteString@@ -100,18 +101,17 @@   restoreM     = defaultRestoreM unStMApiT #endif -instance (MonadException m, MonadBaseControl IO m) => MonadException (ResourceT m) where-  throw     = lift . throw-  catch c f = lift (runResourceT c `catch` (runResourceT . f))--instance (MonadException m, MonadBaseControl IO m) => MonadException (ApiT m) where-  throw     = lift . throw-  catch c f = ApiT (unApiT c `catch` (unApiT . f))- instance MonadThrow m => MonadThrow (ApiT m) where throwM = ApiT . lift . lift . lift . throwM +instance MonadCatch m => MonadCatch (ApiT m) where catch c f = ApiT (unApiT c `catch` (unApiT . f))+ instance (MonadIO m, MonadThrow m, MonadBase IO m, PrimMonad IO, Functor m, Applicative m) => MonadResource (ApiT m) where   liftResourceT = ApiT . lift . lift . transResourceT liftIO++instance ApiStateC m => ApiStateC (ExceptT e m) where+  getApiState = lift getApiState+  askApiInfo  = lift askApiInfo+  putApiState = lift . putApiState  instance (Error e, ApiStateC m) => ApiStateC (ErrorT e m) where   getApiState = lift getApiState