resourcet 1.2.5 → 1.2.6
raw patch · 3 files changed
+17/−1 lines, 3 files
Files
- ChangeLog.md +4/−0
- UnliftIO/Resource.hs +12/−0
- resourcet.cabal +1/−1
ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog for resourcet +## 1.2.6++* Add `allocateU` [#490](https://github.com/snoyberg/conduit/pull/490)+ ## 1.2.5 * Support `transformers-0.6` / `mtl-2.3`
UnliftIO/Resource.hs view
@@ -5,6 +5,7 @@ ( -- * UnliftIO variants runResourceT , liftResourceT+ , allocateU -- * Reexports , module Control.Monad.Trans.Resource ) where@@ -25,3 +26,14 @@ -- @since 1.1.10 liftResourceT :: MonadIO m => ResourceT IO a -> ResourceT m a liftResourceT (ResourceT f) = ResourceT $ liftIO . f++-- | Unlifted 'allocate'.+--+-- @since 1.2.6+allocateU+ :: (MonadUnliftIO m, MonadResource m)+ => m a+ -> (a -> m ())+ -> m (ReleaseKey, a)+allocateU alloc free = withRunInIO $ \run ->+ run $ allocate (run alloc) (run . free)
resourcet.cabal view
@@ -1,5 +1,5 @@ Name: resourcet-Version: 1.2.5+Version: 1.2.6 Synopsis: Deterministic allocation and freeing of scarce resources. description: Hackage documentation generation is not reliable. For up to date documentation, please see: <http://www.stackage.org/package/resourcet>. License: BSD3