on master help sign in
Rename bracket3IO to bracketIO3
commit1ad9034585234ef5be383c81cbc6335cc0a1dcd1 authorHarendra Kumar <harendra@composewell.com> dateWed 14 Dec 2022, 16:16 (4 years ago) parentc1d69c8
2 files changed+7−7
core/src/Streamly/Data/Stream.hs+1−1 core/src/Streamly/Internal/Data/Stream/Exception.hs+6−6
core/src/Streamly/Data/Stream.hs+1−1
@@ -453,7 +453,7 @@ module Streamly.Data.Stream
453453 , afterIO
454454 , finallyIO
455455 , bracketIO
456− , bracket3IO
456+ , bracketIO3
457457
458458 -- * Transforming Inner Monad
459459
core/src/Streamly/Internal/Data/Stream/Exception.hs+6−6
@@ -13,7 +13,7 @@ module Streamly.Internal.Data.Stream.Exception
1313 , afterIO
1414 , bracketUnsafe
1515 , bracketIO
16− , bracket3IO
16+ , bracketIO3
1717 , onException
1818 , finallyUnsafe
1919 , finallyIO
@@ -158,7 +158,7 @@ bracketUnsafe bef aft bet = fromStreamD $ D.bracket_ bef aft (toStreamD . bet)
158158{-# INLINE bracketIO #-}
159159bracketIO :: (MonadIO m, MonadCatch m)
160160 => IO b -> (b -> IO c) -> (b -> Stream m a) -> Stream m a
161−bracketIO bef aft = bracket3IO bef aft aft aft
161+bracketIO bef aft = bracketIO3 bef aft aft aft
162162
163163-- For a use case of this see the "streamly-process" package. It needs to kill
164164-- the process in case of exception or garbage collection, but waits for the
@@ -171,21 +171,21 @@ bracketIO bef aft = bracket3IO bef aft aft aft
171171-- 2. When the stream is garbage collected
172172-- 3. When the stream encounters an exception
173173--
174−-- @bracket3IO before onStop onGC onException action@ runs @action@ using the
174+-- @bracketIO3 before onStop onGC onException action@ runs @action@ using the
175175-- result of @before@. If the stream stops, @onStop@ action is executed, if the
176176-- stream is abandoned @onGC@ is executed, if the stream encounters an
177177-- exception @onException@ is executed.
178178--
179179-- /Pre-release/
180−{-# INLINE bracket3IO #-}
181−bracket3IO :: (MonadIO m, MonadCatch m)
180+{-# INLINE bracketIO3 #-}
181+bracketIO3 :: (MonadIO m, MonadCatch m)
182182 => IO b
183183 -> (b -> IO c)
184184 -> (b -> IO d)
185185 -> (b -> IO e)
186186 -> (b -> Stream m a)
187187 -> Stream m a
188−bracket3IO bef aft gc exc bet = fromStreamD $
188+bracketIO3 bef aft gc exc bet = fromStreamD $
189189 D.bracket' bef aft exc gc (toStreamD . bet)
190190
191191-- | Like 'handle' but the exception handler is also provided with the stream