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.
mapM_ is just like
traverse_, but specialised to monadic
actions.
Apply the action to all values in the stream.
Note: if you want to
pass the values instead of
consuming them, use
iterM instead.
Subject to fusion
Apply the action to all values in the stream.
Subject to fusion
Since 0.3.0
Perform a computation on each Word8 in a stream.
Since 1.0.10
Consume all values using a monadic function
Converts an effectful function to a fold. Specialized version of
sink.
Maps a side effect over an
InputStream.
mapM_ f s produces a new input stream that passes all output
from
s through the side-effecting IO action
f.
Example:
ghci> Streams.fromList [1,2,3] >>=
Streams.mapM_ (putStrLn . show . (*2)) >>=
Streams.toList
2
4
6
[1,2,3]
A side-effecting map over the key-value records of a hash table.
O(n).
See the documentation for this function in
mapM_.
See the documentation for this function in
mapM_.
See the documentation for this function in
mapM_.
Reduce a stream to its return value with a monadic action.
>>> S.mapM_ Prelude.print $ each [1..3]
1
2
3
>>> rest <- S.mapM_ Prelude.print $ S.splitAt 3 $ each [1..10]
1
2
3
>>> S.sum rest
49 :> ()
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
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
A map in monad space, discarding results.
mapM_ = Stream.drain . Stream.mapM
Apply a monadic action to each element of the stream and discard the
output of the action. This is not really a pure transformation
operation but a transformation followed by fold.
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_ =
traverse_