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.