:: (Foldable t, Monad m) => (a -> m b) -> t a -> m () package:rebase

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. mapM_ is just like traverse_, but specialised to monadic actions.
Map each element of a structure to an Applicative action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see traverse. traverse_ is just like mapM_, but generalised to Applicative actions.

Examples

Basic usage:
>>> traverse_ print ["Hello", "world", "!"]
"Hello"
"world"
"!"
forM_ is mapM_ with its arguments flipped. For a version that doesn't ignore the results see forM. forM_ is just like for_, but specialised to monadic actions.