for_ package:verset

for_ is traverse_ with its arguments flipped. For a version that doesn't ignore the results see for. This is forM_ generalised to Applicative actions. for_ is just like forM_, but generalised to Applicative actions.

Examples

Basic usage:
>>> for_ [1..4] print
1
2
3
4
As bitraverse_, but with the structure as the primary argument. For a version that doesn't ignore the results, see bifor.

Examples

Basic usage:
>>> bifor_ ("Hello", True) print (print . show)
"Hello"
"True"
>>> bifor_ (Right True) print (print . show)
"True"
>>> bifor_ (Left "Hello") print (print . show)
"Hello"