on master help sign in
mention left folds vs right folds
c1cbe18Harendra Kumar
src/Streamly/Data/Fold.hs+9
@@ -37,6 +37,15 @@
37-- on stream types can be as efficient as transformations on 'Fold' (e.g.
37-- on stream types can be as efficient as transformations on 'Fold' (e.g.
38-- 'Streamly.Internal.Data.Fold.lmap').
38-- 'Streamly.Internal.Data.Fold.lmap').
39--
39--
40+-- = Left folds vs Right Folds
41+--
42+-- The folds in this module are left folds, therefore, even partial folds, e.g.
43+-- @head@ in this module, would drain the whole stream. On the other hand, the
44+-- partial folds in "Streamly.Prelude" module are lazy right folds and would
45+-- terminate as soon as the result is determined. However, the folds in this
46+-- module can be composed but the folds in "Streamly.Prelude" cannot be
47+-- composed.
48+--
40-- = Programmer Notes
49-- = Programmer Notes
41--
50--
42-- > import qualified Streamly.Data.Fold as FL
51-- > import qualified Streamly.Data.Fold as FL