streamly
streamly copied to clipboard
Use Fold and Unfold only in new stream modules
The newer monomorphic serial stream module in 0.9.0 should abandon the folds and generation functions in Prelude and try to use only Fold and Unfold for these purposes. All the conventional fold/generation functions should be expressible in terms of folds/unfolds.
Streams and Folds are dual to each other. We decided to remove folds from the Stream module and exclusively use the Fold type for stream consumers. However, for generation we would use Stream rather than Unfolds. Unfolds are mainly for nesting use cases where we need good performance.