resourcet 1.1.3.1 → 1.1.3.2
raw patch · 3 files changed
+25/−6 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
- Control/Monad/Trans/Resource/Internal.hs +18/−3
- resourcet.cabal +3/−3
ChangeLog.md view
@@ -1,3 +1,7 @@+## 1.1.3.2++monad-control-1.0 support [#191](https://github.com/snoyberg/conduit/pull/191)+ ## 1.1.3 Provide the `withEx` function to interact nicely with the exceptions package.
Control/Monad/Trans/Resource/Internal.hs view
@@ -25,8 +25,7 @@ import Control.Exception (throw,Exception,SomeException) import Control.Applicative (Applicative (..)) import Control.Monad.Trans.Control- ( MonadTransControl (..), MonadBaseControl (..)- , ComposeSt, defaultLiftBaseWith, defaultRestoreM, control)+ ( MonadTransControl (..), MonadBaseControl (..) ) import Control.Monad.Base (MonadBase, liftBase) import Control.Monad.Trans.Cont ( ContT ) import Control.Monad.Cont.Class ( MonadCont (..) )@@ -50,7 +49,9 @@ import qualified Control.Monad.Trans.Writer.Strict as Strict ( WriterT ) import Control.Monad.IO.Class (MonadIO (..))-import Control.Monad (liftM, ap)+#if !(MIN_VERSION_monad_control(1,0,0))+import Control.Monad (liftM)+#endif import qualified Control.Exception as E import Control.Monad.ST (ST) import Control.Monad.Catch (MonadThrow (..), MonadCatch (..)@@ -250,18 +251,32 @@ liftBase = lift . liftBase instance MonadTransControl ResourceT where+#if MIN_VERSION_monad_control(1,0,0)+ type StT ResourceT a = a+ liftWith f = ResourceT $ \r -> f $ \(ResourceT t) -> t r+ restoreT = ResourceT . const+#else newtype StT ResourceT a = StReader {unStReader :: a} liftWith f = ResourceT $ \r -> f $ \(ResourceT t) -> liftM StReader $ t r restoreT = ResourceT . const . liftM unStReader+#endif {-# INLINE liftWith #-} {-# INLINE restoreT #-} instance MonadBaseControl b m => MonadBaseControl b (ResourceT m) where+#if MIN_VERSION_monad_control(1,0,0)+ type StM (ResourceT m) a = StM m a+ liftBaseWith f = ResourceT $ \reader' ->+ liftBaseWith $ \runInBase ->+ f $ runInBase . (\(ResourceT r) -> r reader' )+ restoreM = ResourceT . const . restoreM+#else newtype StM (ResourceT m) a = StMT (StM m a) liftBaseWith f = ResourceT $ \reader' -> liftBaseWith $ \runInBase -> f $ liftM StMT . runInBase . (\(ResourceT r) -> r reader' ) restoreM (StMT base) = ResourceT $ const $ restoreM base+#endif #define GO(T) instance (MonadResource m) => MonadResource (T m) where liftResourceT = lift . liftResourceT #define GOX(X, T) instance (X, MonadResource m) => MonadResource (T m) where liftResourceT = lift . liftResourceT
resourcet.cabal view
@@ -1,7 +1,7 @@ Name: resourcet-Version: 1.1.3.1+Version: 1.1.3.2 Synopsis: Deterministic allocation and freeing of scarce resources.-Description: See README.md+description: Hackage documentation generation is not reliable. For up to date documentation, please see: <http://www.stackage.org/package/resourcet>. License: BSD3 License-file: LICENSE Author: Michael Snoyman@@ -20,7 +20,7 @@ Build-depends: base >= 4.3 && < 5 , lifted-base >= 0.1 , transformers-base >= 0.4.1 && < 0.5- , monad-control >= 0.3.1 && < 0.4+ , monad-control >= 0.3.1 && < 1.1 , containers , transformers >= 0.2.2 && < 0.5 , mtl >= 2.0 && < 2.3