Search results

for_ :: forall a b f m. Applicative m => Foldable f => f a -> (a -> m b) -> m Unit

A version of traverse_ with its arguments flipped.

This can be useful when running an action written using do notation for every element in a data structure:

For example:

for_ [1, 2, 3] \n -> do
  print n
  trace "squared is"
  print (n * n)
P purescript-foldable-traversable M Data.Foldable
for_ :: forall f m a. Foldable f => MonadRec m => f a -> (a -> m Unit) -> m Unit

Safely traverse a foldable container.

P purescript-safely M Control.Safely

No further results.