Hoogle Search
Within LTS Haskell 24.64 (ghc-9.10.3)
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)ghc-lib GHC.HsToCore.Monad 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.-
hybrid-vectors Data.Vector.Hybrid O(n) Apply the monadic action to all elements of the vector, yielding a vector of results
mapM :: MonadUnliftIO m => (a -> m b) -> InputStream a -> m (InputStream b)unliftio-streams UnliftIO.Streams.Combinators No documentation available.
type family
MapM (arg :: a ~> m b) (arg1 :: t a) :: m t bsingletons-base Control.Monad.Singletons No documentation available.
mapMaybe :: (a -> Maybe b) -> KeyMap a -> KeyMap baeson Data.Aeson.KeyMap Map values and collect the Just results.
mapMaybeWithKey :: (Key -> v -> Maybe u) -> KeyMap v -> KeyMap uaeson Data.Aeson.KeyMap Map values and collect the Just results.
mapMaybe :: (v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2unordered-containers Data.HashMap.Internal Transform this map by applying a function to every value and retaining only some of them.
mapMaybeWithKey :: (k -> v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2unordered-containers Data.HashMap.Internal Transform this map by applying a function to every value and retaining only some of them.
mapMaybe :: (v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2unordered-containers Data.HashMap.Internal.Strict Transform this map by applying a function to every value and retaining only some of them.
mapMaybeWithKey :: (k -> v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2unordered-containers Data.HashMap.Internal.Strict Transform this map by applying a function to every value and retaining only some of them.