@@ -4829,24 +4829,25 @@ classifySessionsOf interval =
48294829before :: (IsStream t, Monad m) => m b -> t m a -> t m a
48304830before action xs = D.fromStreamD $ D.before action $ D.toStreamD xs
48314831
4832−-- | Run a side effect whenever the stream stops normally.
4832+-- | Run a side effect at the end of the stream. The side effect won't run if
4833+-- the stream is garbage collected before it reached the end.
48334834--
4834−-- Prefer 'after' over this as the @after@ action in this combinator is not
4835−-- executed if the stream is partially evaluated lazily and then garbage
4836−-- collected.
4835+-- This has slightly better performance than 'after'.
4836+--
4837+-- /Internal/
48374838--
4838−-- @since 0.7.0
48394839{-# INLINE after_ #-}
48404840after_ :: (IsStream t, Monad m) => m b -> t m a -> t m a
48414841after_ action xs = D.fromStreamD $ D.after_ action $ D.toStreamD xs
48424842
4843−-- | Run a side effect whenever the stream stops normally
4844−-- or is garbage collected after a partial lazy evaluation.
4843+-- | Run a side effect at the end of the stream or if it is garbage collected
4844+-- even before reaching the end.
48454845--
4846−-- /Internal/
4846+-- @since 0.7.0
48474847--
48484848{-# INLINE after #-}
4849−after :: (IsStream t, MonadIO m, MonadBaseControl IO m) => m b -> t m a -> t m a
4849+after :: (IsStream t, MonadIO m, MonadBaseControl IO m)
4850+ => m b -> t m a -> t m a
48504851after action xs = D.fromStreamD $ D.after action $ D.toStreamD xs
48514852
48524853-- | Run a side effect whenever the stream aborts due to an exception.
@@ -4856,22 +4857,22 @@ after action xs = D.fromStreamD $ D.after action $ D.toStreamD xs
48564857onException :: (IsStream t, MonadCatch m) => m b -> t m a -> t m a
48574858onException action xs = D.fromStreamD $ D.onException action $ D.toStreamD xs
48584859
4859−-- | Run a side effect whenever the stream stops normally or aborts due to an
4860−-- exception.
4860+-- | Run a side effect at the end of the stream or if it aborts due to an
4861+-- exception before it could reach the end. The side effect is not run if the
4862+-- stream is garbage collected before reaching the end.
48614863--
4862−-- Prefer 'finally' over this as the @after@ action in this combinator is not
4863−-- executed if the unfold is partially evaluated lazily and then garbage
4864−-- collected.
4864+-- This has slightly better performance than 'finally'.
4865+--
4866+-- /Internal/
48654867--
4866−-- @since 0.7.0
48674868{-# INLINE finally_ #-}
48684869finally_ :: (IsStream t, MonadCatch m) => m b -> t m a -> t m a
48694870finally_ action xs = D.fromStreamD $ D.finally_ action $ D.toStreamD xs
48704871
4871−-- | Run a side effect whenever the stream stops normally, aborts due to an
4872−-- exception or if it is garbage collected after a partial lazy evaluation.
4872+-- | Run a side effect at the end of the stream, or if it aborts due to an
4873+-- exception or if it is garbage collected before it could reach the end.
48734874--
4874−-- /Internal/
4875+-- @since 0.7.0
48754876--
48764877{-# INLINE finally #-}
48774878finally :: (IsStream t, MonadAsync m, MonadCatch m) => m b -> t m a -> t m a
@@ -4880,13 +4881,13 @@ finally action xs = D.fromStreamD $ D.finally action $ D.toStreamD xs
48804881-- | Run the first action before the stream starts and remember its output,
48814882-- generate a stream using the output, run the second action using the
48824883-- remembered value as an argument whenever the stream ends normally or due to
4883−-- an exception.
4884+-- an exception. The second action won't run if the stream is garbage collected
4885+-- before it could reach the end.
48844886--
4885−-- Prefer 'bracket' over this as the @after@ action in this combinator is not
4886−-- executed if the unfold is partially evaluated lazily and then garbage
4887−-- collected.
4887+-- This has slightly better performance than 'bracket'.
4888+--
4889+-- /Internal/
48884890--
4889−-- @since 0.7.0
48904891{-# INLINE bracket_ #-}
48914892bracket_ :: (IsStream t, MonadCatch m)
48924893 => m b -> (b -> m c) -> (b -> t m a) -> t m a
@@ -4898,7 +4899,7 @@ bracket_ bef aft bet = D.fromStreamD $
48984899-- remembered value as an argument whenever the stream ends normally, due to
48994900-- an exception or if it is garbage collected after a partial lazy evaluation.
49004901--
4901−-- /Internal/
4902+-- @since 0.7.0
49024903--
49034904{-# INLINE bracket #-}
49044905bracket :: (IsStream t, MonadAsync m, MonadCatch m)