rest-client 0.4.0.1 → 0.4.0.2
raw patch · 3 files changed
+18/−3 lines, 3 filesdep ~monad-controlPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: monad-control
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- rest-client.cabal +2/−2
- src/Rest/Client/Base.hs +12/−1
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Changelog +#### 0.4.0.2++* Support `monad-control == 1.0.*`.+ #### 0.4.0.1 * Bump `rest-types`
rest-client.cabal view
@@ -1,5 +1,5 @@ name: rest-client-version: 0.4.0.1+version: 0.4.0.2 description: Utility library for use in generated API client libraries. synopsis: Utility library for use in generated API client libraries. maintainer: code@silk.co@@ -34,7 +34,7 @@ , http-types >= 0.7 && < 0.9 , hxt >= 9.2 && < 9.4 , hxt-pickle-utils == 0.1.*- , monad-control == 0.3.*+ , monad-control >= 0.3 && < 1.1 , mtl >= 2.0 && < 2.3 , primitive == 0.5.* , resourcet == 1.1.*
src/Rest/Client/Base.hs view
@@ -26,7 +26,6 @@ #endif import Control.Applicative-import Control.Monad import Control.Monad.Base import Control.Monad.Cont hiding (mapM) import Control.Monad.Error hiding (mapM)@@ -79,7 +78,18 @@ instance MonadBase b m => MonadBase b (ApiT m) where liftBase = liftBaseDefault +#if MIN_VERSION_monad_control(1,0,0) instance MonadTransControl ApiT where+ type StT ApiT a = StT ResourceT (StT (ReaderT ApiInfo) (StT (StateT ApiState) a))+ liftWith f = ApiT (liftWith (\runs -> liftWith (\runrr -> liftWith (\runrs -> f (runrs . runrr . runs . unApiT)))))+ restoreT = ApiT . restoreT . restoreT . restoreT++instance MonadBaseControl v m => MonadBaseControl v (ApiT m) where+ type StM (ApiT m) a = ComposeSt ApiT m a+ liftBaseWith = defaultLiftBaseWith+ restoreM = defaultRestoreM+#else+instance MonadTransControl ApiT where newtype StT ApiT a = StTApiT { unStTApiT :: StT ResourceT (StT (ReaderT ApiInfo) (StT (StateT ApiState) a)) } liftWith f = ApiT (liftWith (\runs -> liftWith (\runrr -> liftWith (\runrs -> f (liftM StTApiT . runrs . runrr . runs . unApiT))))) restoreT = ApiT . restoreT . restoreT . restoreT . liftM unStTApiT@@ -88,6 +98,7 @@ newtype StM (ApiT m) a = StMApiT { unStMApiT :: ComposeSt ApiT m a } liftBaseWith = defaultLiftBaseWith StMApiT restoreM = defaultRestoreM unStMApiT+#endif instance (MonadException m, MonadBaseControl IO m) => MonadException (ResourceT m) where throw = lift . throw