@@ -320,6 +320,8 @@
320module Streamly.Prelude
320module Streamly.Prelude
322 -- * Construction
322 -- * Construction
323+ -- | Functions ending in the general shape @b -> t m a@
323 -- ** Primitives
325 -- ** Primitives
324 -- | Primitives to construct a stream from pure values or monadic actions.
326 -- | Primitives to construct a stream from pure values or monadic actions.
325 -- All other stream construction and generation combinators described later
327 -- All other stream construction and generation combinators described later
@@ -386,17 +388,22 @@ module Streamly.Prelude
386 , fromFoldableM
388 , fromFoldableM
388 -- * Elimination
390 -- * Elimination
391+ -- | Functions ending in the general shape @t m a -> m b@
393+ -- ** Running a 'Fold'
390 -- ** Deconstruction
399 -- ** Deconstruction
391− -- | It is easy to express all the folds in terms of the 'uncons' primitive,
400+ -- | Functions ending in the general shape @t m a -> m (b, t m a)@
392− -- however the specific implementations provided later are generally more
401+
399− -- ** Folding
406+ -- ** General Folds
400-- | In imperative terms a fold can be considered as a loop over the stream
407-- | In imperative terms a fold can be considered as a loop over the stream
401-- that reduces the stream to a single value.
408-- that reduces the stream to a single value.
402-- Left and right folds both use a fold function @f@ and an identity element
409-- Left and right folds both use a fold function @f@ and an identity element
@@ -466,24 +473,19 @@ module Streamly.Prelude
466-- the previous step. However, it is possible to fold parts of the stream in
473-- the previous step. However, it is possible to fold parts of the stream in
467-- parallel and then combine the results using a monoid.
474-- parallel and then combine the results using a monoid.
469− -- ** Right Folds
476+ -- *** Right Folds
470 -- $rightfolds
477 -- $rightfolds
474− -- ** Left Folds
481+ -- *** Left Folds
475 -- $leftfolds
482 -- $leftfolds
477 , foldl1'
484 , foldl1'
478 , foldlM'
485 , foldlM'
480− -- ** Composable Left Folds
487+ -- ** Specific Folds
486− -- ** Full Folds
488+ -- *** Full Folds
487 -- | Folds that are guaranteed to evaluate the whole stream.
489 -- | Folds that are guaranteed to evaluate the whole stream.
489 -- -- ** To Summary (Full Folds)
491 -- -- ** To Summary (Full Folds)
@@ -503,17 +505,7 @@ module Streamly.Prelude
503 , minimum
505 , minimum
508− -- | Folds that generate a lazy structure. Note that the generated
509− -- structure may not be lazy if the underlying monad is strict.
511− -- -- ** To Containers (Full Folds)
512− -- -- | Convert or divert a stream into an output structure, container or
516− -- ** Partial Folds
508+ -- *** Partial Folds
517 -- | Folds that may terminate before evaluating the whole stream. These
509 -- | Folds that may terminate before evaluating the whole stream. These
518 -- folds strictly evaluate the stream until the result is determined.
510 -- folds strictly evaluate the stream until the result is determined.
@@ -540,6 +532,14 @@ module Streamly.Prelude
535+ -- *** To Containers
536+ -- | Convert a stream into a container holding all the values.
539+ -- ** Folding Concurrently
543 -- ** Multi-Stream folds
543 -- ** Multi-Stream folds
@@ -553,8 +553,6 @@ module Streamly.Prelude
553 -- $application
553 -- $application
559 -- * Transformation
557 -- * Transformation