The mapAndUnzipM function maps its first argument over a list,
returning the result as a pair of lists. This function is mainly used
with complicated data structures or a state-transforming monad.
Map each element of a structure to a monadic action, evaluate these
actions from left to right, and collect the results. For a version
that ignores the results see mapM_.
Map each element of a structure to a monadic action, evaluate these
actions from left to right, and ignore the results. For a version that
doesn't ignore the results see mapM.
As of base 4.8.0.0, mapM_ is just traverse_, specialized
to Monad.