on master help sign in
Explain when to use a particular constructor
commitcea676230d903848c14b8941072b3254584309c7 authorHarendra Kumar <harendra@composewell.com> dateMon 14 Mar 2022, 12:59 (5 years ago) parent5e7fb87
1 file changed+9
core/src/Streamly/Internal/Data/Fold.hs+9
core/src/Streamly/Internal/Data/Fold.hs+9
@@ -19,6 +19,15 @@ module Streamly.Internal.Data.Fold
1919 , Fold (..)
2020
2121 -- * 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+ --
2231 , foldl'
2332 , foldlM'
2433 , foldl1'