Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapM :: (IsStream t, MonadAsync m) => (a -> m b) -> t m a -> t m bstreamly Streamly.Internal.Data.Stream.IsStream mapM f = sequence . map f
Apply a monadic function to each element of the stream and replace it with the output of the resulting action.>>> drain $ Stream.mapM putStr $ Stream.fromList ["a", "b", "c"] abc >>> :{ drain $ Stream.replicateM 10 (return 1) & (fromSerial . Stream.mapM (x -> threadDelay 1000000 >> print x)) :} 1 ... 1 > drain $ Stream.replicateM 10 (return 1) & (fromAsync . Stream.mapM (x -> threadDelay 1000000 >> print x))
Concurrent (do not use with fromParallel on infinite streams)mapM :: Monad m => (a -> m b) -> SerialT m a -> SerialT m bstreamly Streamly.Internal.Data.Stream.Serial No documentation available.
mapM :: (IsStream t, MonadAsync m) => (a -> m b) -> t m a -> t m bstreamly Streamly.Prelude mapM f = sequence . map f
Apply a monadic function to each element of the stream and replace it with the output of the resulting action.>>> drain $ Stream.mapM putStr $ Stream.fromList ["a", "b", "c"] abc >>> :{ drain $ Stream.replicateM 10 (return 1) & (fromSerial . Stream.mapM (x -> threadDelay 1000000 >> print x)) :} 1 ... 1 > drain $ Stream.replicateM 10 (return 1) & (fromAsync . Stream.mapM (x -> threadDelay 1000000 >> print x))
Concurrent (do not use with fromParallel on infinite streams)mapM :: (Monad m, Unboxable a, Unboxable b) => (a -> m b) -> Vector a -> m (Vector b)unboxing-vector Data.Vector.Unboxing No documentation available.
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)classy-prelude-yesod ClassyPrelude.Yesod Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.
Examples
mapM is literally a traverse with a type signature restricted to Monad. Its implementation may be more efficient due to additional power of Monad.-
constrained-categories Control.Category.Constrained.Prelude traverse, restricted to endofunctors. May be more efficient to implement.
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)constrained-categories Control.Category.Hask Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.
Examples
mapM is literally a traverse with a type signature restricted to Monad. Its implementation may be more efficient due to additional power of Monad.-
constrained-categories Control.Monad.Constrained traverse, restricted to endofunctors. May be more efficient to implement.
-
constrained-categories Data.Traversable.Constrained traverse, restricted to endofunctors. May be more efficient to implement.
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)copilot-language Copilot.Language.Prelude Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.
Examples
mapM is literally a traverse with a type signature restricted to Monad. Its implementation may be more efficient due to additional power of Monad.