resourcet 1.2.3 → 1.2.4
raw patch · 2 files changed
+18/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Control.Monad.Trans.Resource: allocate_ :: MonadResource m => IO a -> IO () -> m ReleaseKey
Files
- Control/Monad/Trans/Resource.hs +17/−0
- resourcet.cabal +1/−1
Control/Monad/Trans/Resource.hs view
@@ -32,6 +32,7 @@ , joinResourceT -- * Registering/releasing , allocate+ , allocate_ , register , release , unprotect@@ -105,6 +106,22 @@ -> (a -> IO ()) -- ^ free resource -> m (ReleaseKey, a) allocate a = liftResourceT . allocateRIO a++-- | Perform some allocation where the return value is not required, and+-- automatically register a cleanup action.+--+-- @allocate_@ is to @allocate@ as @bracket_@ is to @bracket@+--+-- This is almost identical to calling the allocation and then+-- @register@ing the release action, but this properly handles masking of+-- asynchronous exceptions.+--+-- @since 1.2.4+allocate_ :: MonadResource m+ => IO a -- ^ allocate+ -> IO () -- ^ free resource+ -> m ReleaseKey+allocate_ a = fmap fst . allocate a . const -- | Perform asynchronous exception masking. --
resourcet.cabal view
@@ -1,5 +1,5 @@ Name: resourcet-Version: 1.2.3+Version: 1.2.4 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