on master help sign in
mention left folds vs right folds
commitc1cbe1896c1c33ee18d8610a379c48b886694968 authorHarendra Kumar <harendra.kumar@gmail.com> dateWed 15 Jan 2020, 08:00 (7 years ago) parent7e7cc7e
1 file changed+9
src/Streamly/Data/Fold.hs+9
src/Streamly/Data/Fold.hs+9
@@ -37,6 +37,15 @@
3737-- on stream types can be as efficient as transformations on 'Fold' (e.g.
3838-- 'Streamly.Internal.Data.Fold.lmap').
3939--
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+--
4049-- = Programmer Notes
4150--
4251-- > import qualified Streamly.Data.Fold as FL