on master help sign in
Explain when to use a particular constructor
cea6762Harendra Kumar
core/src/Streamly/Internal/Data/Fold.hs+9
@@ -19,6 +19,15 @@ module Streamly.Internal.Data.Fold
19 , Fold (..)
19 , Fold (..)
20
20
21 -- * Constructors
21 -- * Constructors
22+ -- | Which constructor to use?
23+ --
24+ -- * @foldl*@: If the fold never terminates i.e. does not use the 'Done'
25+ -- constructor otherwise use the @mkFold@ variants.
26+ -- * @*M@: Use the @M@ suffix variants if any of the step, initial, or
27+ -- extract function is monadic, otherwise use the pure variants.
28+ -- * @*_@: Use the @_@ suffix variants if the extract function is 'id' or
29+ -- 'return'.
30+ --
22 , foldl'
31 , foldl'
23 , foldlM'
32 , foldlM'
24 , foldl1'
33 , foldl1'