foldM package:base -is:exact -is:exact -is:exact

The foldM function is analogous to foldl, except that its result is encapsulated in a monad. Note that foldM works from left-to-right over the list arguments. This could be an issue where (>>) and the `folded function' are not commutative.
foldM f a1 [x1, x2, ..., xm]

==

do
a2 <- f a1 x1
a3 <- f a2 x2
...
f am xm
If right-to-left evaluation is required, the input list should be reversed. Note: foldM is the same as foldlM
Map each element of the structure to a monoid, and combine the results.
Like foldM, but discards the result.
This function may be used as a value for foldMap in a Foldable instance.
foldMapDefault f ≡ getConst . traverse (Const . f)
Combines the elements of a structure, given ways of mapping them to a common monoid.
bifoldMap f g
≡ bifoldr (mappend . f) (mappend . g) mempty
A default definition of bifoldMap in terms of the Bitraversable operations.
bifoldMapDefault f g ≡
getConst . bitraverse (Const . f) (Const . g)