mconcat package:streamly-core

Monoid concat. Fold an input stream consisting of monoidal elements using mappend and mempty. Definition:
>>> mconcat = Fold.sconcat mempty
>>> monoids = fmap Data.Monoid.Sum $ Stream.enumerateFromTo 1 10

>>> Stream.fold Fold.mconcat monoids
Sum {getSum = 55}
Monoid concat. Scan an input stream consisting of monoidal elements using mappend and mempty. Definition:
>>> mconcat = Scanl.sconcat mempty
>>> monoids = fmap Data.Monoid.Sum $ Stream.enumerateFromTo 1 3

>>> Stream.toList $ Stream.scanl Scanl.mconcat monoids
[Sum {getSum = 0},Sum {getSum = 1},Sum {getSum = 3},Sum {getSum = 6}]