>>> foldMap f = Scanl.lmap f Scanl.mconcatMake a scan from a pure function that scans the output of the function using mappend and mempty.
>>> sum = Scanl.foldMap Data.Monoid.Sum
>>> Stream.toList $ Stream.scanl sum $ Stream.enumerateFromTo 1 3
[Sum {getSum = 0},Sum {getSum = 1},Sum {getSum = 3},Sum {getSum = 6}]
>>> foldMapM f = Scanl.lmapM f Scanl.mconcatMake a scan from a monadic function that scans the output of the function using mappend and mempty.
>>> sum = Scanl.foldMapM (return . Data.Monoid.Sum)
>>> Stream.toList $ Stream.scanl sum $ Stream.enumerateFromTo 1 3
[Sum {getSum = 0},Sum {getSum = 1},Sum {getSum = 3},Sum {getSum = 6}]