foldM package:rio

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
O(n) Monadic fold
O(n) Monadic fold
O(n) Monadic fold
O(n) Monadic fold
O(n). Fold the keys and values in the map using the given monoid, such that
foldMapWithKey f = fold . mapWithKey f
This can be an asymptotically faster than foldrWithKey or foldlWithKey for some monoids.
Like foldM, but discards the result.
Map each element of the structure to a monoid, and combine the results.
Extend foldMap to allow side effects. Internally, this is implemented using a strict left fold. This is used for performance reasons. It also necessitates that this function has a Monad constraint and not just an Applicative constraint. For more information, see https://github.com/commercialhaskell/rio/pull/99#issuecomment-394179757.
O(n) Monadic fold with strict accumulator
O(n) Monadic fold with strict accumulator that discards the result
O(n) Monadic fold that discards the result
O(n) Monadic fold with strict accumulator
O(n) Monadic fold with strict accumulator that discards the result
O(n) Monadic fold that discards the result
O(n) Monadic fold with strict accumulator
O(n) Monadic fold with strict accumulator that discards the result
O(n) Monadic fold that discards the result
O(n) Monadic fold with strict accumulator
O(n) Monadic fold with strict accumulator that discards the result
O(n) Monadic fold that discards the result
Combines the elements of a structure, given ways of mapping them to a common monoid.
bifoldMap f g
≡ bifoldr (mappend . f) (mappend . g) mempty
O(n) Monadic fold (action applied to each element and its index)
O(n) Monadic fold with strict accumulator (action applied to each element and its index)