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 :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)LambdaHack Game.LambdaHack.Core.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 :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)LambdaHack Game.LambdaHack.Core.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_ :: (Foldable t, Monad m) => (a -> m ()) -> t a -> m ()LambdaHack Game.LambdaHack.Core.Prelude This has a more specific type (unit result) than normally, to catch errors.
mappend :: Monoid a => a -> a -> aLambdaHack Game.LambdaHack.Core.Prelude An associative operation NOTE: This method is redundant and has the default implementation mappend = (<>) since base-4.11.0.0. Should it be implemented manually, since mappend is a synonym for (<>), it is expected that the two functions are defined the same way. In a future GHC release mappend will be removed from Monoid.
-
backprop Prelude.Backprop Lifted version of mapAccumL. Prior to v0.2.3, required a Backprop constraint on t b.
-
backprop Prelude.Backprop Lifted version of mapAccumR. Prior to v0.2.3, required a Backprop constraint on t b.
-
backprop Prelude.Backprop.Explicit -
backprop Prelude.Backprop.Explicit -
backprop Prelude.Backprop.Num mapAccumL, but with Num constraints instead of Backprop constraints. Prior to v0.2.3, required a Num constraint on t b.
-
backprop Prelude.Backprop.Num mapAccumR, but with Num constraints instead of Backprop constraints. Prior to v0.2.3, required a Num constraint on t b.