:: Monad m => [a] -> (a -> m ()) -> m () -package:relude
This has a more specific type (unit result) than normally, to catch
errors.
base Control.Monad Data.Foldable,
base-compat Control.Monad.Compat,
protolude Protolude,
base-prelude BasePrelude,
ihaskell IHaskellPrelude,
numhask NumHask.Prelude,
base-compat-batteries Control.Monad.Compat,
Agda Agda.Utils.Monad,
ghc-internal GHC.Internal.Control.Monad GHC.Internal.Data.Foldable,
rebase Rebase.Prelude,
persistent-test Init,
massiv-test Test.Massiv.Utils,
incipit-base Incipit.Foldable,
faktory Faktory.Prelude,
can-i-haz Control.Monad.Except.CoHas Control.Monad.Reader.Has,
verset Verset,
calligraphy Calligraphy.Prelude,
distribution-opensuse OpenSuse.Prelude 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.
forM_ is
mapM_ with its arguments flipped. For a version
that doesn't ignore the results see
forM.
As of base 4.8.0.0,
forM_ is just
for_, specialized to
Monad.
O(n) Apply the monadic action to all elements of a vector and
ignore the results. Equivalent to
flip mapM_.
Like
forM_, but applying the function to the individual list
items in parallel.
base Data.Foldable,
protolude Protolude,
base-prelude BasePrelude,
Cabal-syntax Distribution.Compat.Prelude,
numhask NumHask.Prelude,
ghc-internal GHC.Internal.Data.Foldable,
rebase Rebase.Prelude,
xmonad-contrib XMonad.Prelude,
incipit-base Incipit.Foldable,
cabal-install-solver Distribution.Solver.Compat.Prelude,
faktory Faktory.Prelude,
verset Verset,
calligraphy Calligraphy.Prelude 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
for_ is
traverse_ with its arguments flipped. For a
version that doesn't ignore the results see
for.
>>> for_ [1..4] print
1
2
3
4
Generalized version of for_ :: Applicative m => [a] -> (a
-> m ()) -> m ()
A version of mconcatMap that works with a monadic predicate.
Maps a splice generating function over a list and concatenates the
results. This function now has a more general type signature so it
works with both compiled and interpreted splices. The old type
signature was this:
mapSplices :: (Monad n)
=> (a -> Splice n n)
-> [a]
-> Splice n n
This has a more specific type (unit result) than normally, to catch
errors.
base Prelude Control.Monad Data.Foldable,
hedgehog Hedgehog.Internal.Prelude,
base-compat Control.Monad.Compat Prelude.Compat,
protolude Protolude,
haskell-gi-base Data.GI.Base.ShortPrelude,
base-prelude BasePrelude,
ihaskell IHaskellPrelude,
numhask NumHask.Prelude NumHask.Prelude,
base-compat-batteries Control.Monad.Compat,
ghc-lib-parser GHC.Prelude.Basic,
ghc-internal GHC.Internal.Control.Monad GHC.Internal.Data.Foldable,
dimensional Numeric.Units.Dimensional.Prelude,
rebase Rebase.Prelude,
mixed-types-num Numeric.MixedTypes.PreludeHiding,
xmonad-contrib XMonad.Config.Prime,
constrained-categories Control.Category.Hask,
copilot-language Copilot.Language.Prelude,
massiv-test Test.Massiv.Utils,
incipit-base Incipit.Foldable,
faktory Faktory.Prelude,
can-i-haz Control.Monad.Except.CoHas Control.Monad.Reader.Has,
calligraphy Calligraphy.Prelude,
distribution-opensuse OpenSuse.Prelude OpenSuse.Prelude 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 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.
O(n) Apply the monadic action to all elements of a vector and
ignore the results.
O(n) Apply the monadic action to all elements of a vector and
ignore the results
This is generally a faster way to traverse while ignoring the result
rather than using
mapM_.
Like
mapM_, but applying the function to the individual list
items in parallel.