Skip to content

Commit

Permalink
Update docs encouraging the use of before over nilM
Browse files Browse the repository at this point in the history
  • Loading branch information
adithyaov committed Dec 19, 2024
1 parent 8d913e3 commit 20f6b6b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion core/src/Streamly/Internal/Data/Stream/Exception.hs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ gbracket bef aft onExc onGC ftry action =
--
-- Same as the following but more efficient due to fusion:
--
-- >>> before action xs = Stream.nilM action <> xs
-- >>> before action xs = Stream.concatMap (const xs) (Stream.fromEffect action)
--
{-# INLINE_NORMAL before #-}
Expand Down
1 change: 1 addition & 0 deletions core/src/Streamly/Internal/Data/Stream/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ pattern Stream step state <- (unShare -> UnStream step state)
-- | A stream that terminates without producing any output, but produces a side
-- effect.
--
-- >>> nilM action = Stream.before action Stream.nil
-- >>> Stream.fold Fold.toList (Stream.nilM (print "nil"))
-- "nil"
-- []
Expand Down

0 comments on commit 20f6b6b

Please sign in to comment.