Hoogle Search
Within LTS Haskell 24.2 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapM :: Monad m => (a -> m b) -> Pipe a b m rpipes Pipes.Prelude Apply a monadic function to all values flowing downstream
mapM return = cat mapM (f >=> g) = mapM f >-> mapM g
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)haskell-gi-base Data.GI.Base.ShortPrelude 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.mapM :: (a -> IO b) -> InputStream a -> IO (InputStream b)io-streams System.IO.Streams.Combinators Maps an impure function over an InputStream. mapM f s passes all output from s through the IO action f. Satisfies the following laws:
Streams.mapM (f >=> g) === Streams.mapM f >=> Streams.mapM g Streams.mapM return === Streams.makeInputStream . Streams.read
mapM :: Monad m => (a -> m b) -> Exceptional e a -> m (Exceptional e b)explicit-exception Control.Monad.Exception.Asynchronous.Lazy No documentation available.
mapM :: Monad m => (a -> m b) -> Exceptional e a -> m (Exceptional e b)explicit-exception Control.Monad.Exception.Asynchronous.Strict No documentation available.
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)rio RIO.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.mapM :: (Monad m, Vector v a, Vector v b) => (a -> m b) -> v a -> m (v b)rio RIO.Vector No documentation available.
mapM :: Monad m => (a -> m b) -> Vector a -> m (Vector b)rio RIO.Vector.Boxed No documentation available.
mapM :: (Monad m, Storable a, Storable b) => (a -> m b) -> Vector a -> m (Vector b)rio RIO.Vector.Storable No documentation available.
mapM :: (Monad m, Unbox a, Unbox b) => (a -> m b) -> Vector a -> m (Vector b)rio RIO.Vector.Unboxed No documentation available.