Hoogle Search
Within LTS Haskell 24.6 (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)base-compat-batteries Control.Monad.Compat 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 b) -> t a -> m ()base-compat-batteries Control.Monad.Compat 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.
mappend :: Monoid a => a -> a -> abase-compat-batteries Data.Monoid.Compat 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.
mapSeverity :: (Severity -> Severity) -> WithSeverity msg -> WithSeverity msgco-log-core Colog.Core.Severity Map the given function over the severity of a WithSeverity. This can be useful to operate generically over the severity, for example:
suppressErrors :: LogAction m (WithSeverity msg) -> LogAction m (WithSeverity msg) suppressErrors = cmap (mapSeverity (s -> if s == Error then Warning else s))
mapBody :: (body0 -> body1) -> T time body0 -> T time body1event-list Data.EventList.Absolute.TimeBody No documentation available.
mapBodyM :: Monad m => (body0 -> m body1) -> T time body0 -> m (T time body1)event-list Data.EventList.Absolute.TimeBody No documentation available.
mapCoincident :: Ord time => ([a] -> [b]) -> T time a -> T time bevent-list Data.EventList.Absolute.TimeBody Apply a function to the lists of coincident events.
mapM :: Monad m => (time0 -> m time1) -> (body0 -> m body1) -> T time0 body0 -> m (T time1 body1)event-list Data.EventList.Absolute.TimeBody No documentation available.
mapM_ :: Monad m => (time -> m ()) -> (body -> m ()) -> T time body -> m ()event-list Data.EventList.Absolute.TimeBody No documentation available.
mapMaybe :: Num time => (body0 -> Maybe body1) -> T time body0 -> T time body1event-list Data.EventList.Absolute.TimeBody No documentation available.