We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 745f742 commit 1588c09Copy full SHA for 1588c09
1 file changed
core/src/Streamly/Internal/Control/Exception.hs
@@ -31,6 +31,7 @@ module Streamly.Internal.Control.Exception
31
, withAcquireIO
32
, acquireWith
33
, acquire
34
+ , acquire_
35
, registerWith
36
, register
37
, hook
@@ -302,6 +303,11 @@ acquireWith pri (AcquireIO f) = f pri
302
303
acquire :: AcquireIO -> IO b -> (b -> IO c) -> IO (b, IO ())
304
acquire = acquireWith Priority2
305
306
+-- | Like 'acquire' but does not return a release action. The resource is freed
307
+-- automatically only.
308
+acquire_ :: AcquireIO -> IO b -> (b -> IO c) -> IO b
309
+acquire_ a b c = fmap fst $ acquire a b c
310
+
311
-- | Like 'register' but specifies a 'Priority' for calling the hook.
312
{-# INLINE registerWith #-}
313
registerWith :: Priority -> AcquireIO -> IO () -> IO ()
0 commit comments