@@ -216,7 +216,16 @@ module Streamly.Data.Stream
216216 -- | Usually you can use the folds in "Streamly.Data.Fold". However, some
217217 -- folds that may be commonly used or may have an edge in performance in
218218 -- some cases are provided here.
219− -- , drain
219+ --
220+ -- Useful idioms:
221+ --
222+ -- >>> foldlM' f a = Stream.fold (Fold.foldlM' f a)
223+ -- >>> foldl1 f = Stream.fold (Fold.foldl1' f)
224+ -- >>> foldl' f a = Stream.fold (Fold.foldl' f a)
225+ -- >>> drain = Stream.fold Fold.drain
226+ -- >>> mapM_ f = Stream.fold (Fold.drainMapM f)
227+ -- >>> length = Stream.fold Fold.length
228+ -- >>> head = Stream.fold Fold.one
220229 , toList
221230
222231 -- * Mapping
@@ -428,7 +437,6 @@ module Streamly.Data.Stream
428437 -- >>> splitOnSuffix p f = Stream.foldMany (Fold.takeEndBy_ p f)
429438 -- >>> groupsBy eq f = Stream.parseMany (Parser.groupBy eq f)
430439 -- >>> groupsByRolling eq f = Stream.parseMany (Parser.groupByRolling eq f)
431− -- >>> wordsBy p f = Stream.parseMany (Parser.wordBy p f)
432440 -- >>> groupsOf n f = Stream.foldMany (Fold.take n f)
433441 , foldMany -- XXX Rename to foldRepeat
434442 , groupsOf