Hoogle Search
Within LTS Haskell 24.18 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m ()) -> mono -> m ()classy-prelude-yesod ClassyPrelude.Yesod Synonym for omapM_
mapM_C :: Monad m => (a -> m ()) -> ConduitT a o m ()classy-prelude-yesod ClassyPrelude.Yesod Apply the action to all values in the stream. Note: if you want to pass the values instead of consuming them, use iterM instead.
mapM_CE :: (Monad m, MonoFoldable mono) => (Element mono -> m ()) -> ConduitT mono o m ()classy-prelude-yesod ClassyPrelude.Yesod Apply the action to all elements in the chunked stream. Note: the same caveat as with mapM_C applies. If you don't want to consume the values, you can use iterM:
iterM (omapM_ f)
mapMaybe :: (a -> Maybe b) -> [a] -> [b]classy-prelude-yesod ClassyPrelude.Yesod The mapMaybe function is a version of map which can throw out elements. In particular, the functional argument returns something of type Maybe b. If this is Nothing, no element is added on to the result list. If it is Just b, then b is included in the result list.
Examples
Using mapMaybe f x is a shortcut for catMaybes $ map f x in most cases:>>> import GHC.Internal.Text.Read ( readMaybe ) >>> let readMaybeInt = readMaybe :: String -> Maybe Int >>> mapMaybe readMaybeInt ["1", "Foo", "3"] [1,3] >>> catMaybes $ map readMaybeInt ["1", "Foo", "3"] [1,3]
If we map the Just constructor, the entire list should be returned:>>> mapMaybe Just [1,2,3] [1,2,3]
-
constrained-categories Control.Category.Constrained.Prelude The distinction between mapM_ and traverse_ doesn't really make sense on grounds of Monoidal / Applicative vs Monad, but it has in fact some benefits to restrict this to endofunctors, to make the constraint list at least somewhat shorter.
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()constrained-categories Control.Category.Hask 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.
-
constrained-categories Control.Monad.Constrained The distinction between mapM_ and traverse_ doesn't really make sense on grounds of Monoidal / Applicative vs Monad, but it has in fact some benefits to restrict this to endofunctors, to make the constraint list at least somewhat shorter.
-
constrained-categories Data.Foldable.Constrained The distinction between mapM_ and traverse_ doesn't really make sense on grounds of Monoidal / Applicative vs Monad, but it has in fact some benefits to restrict this to endofunctors, to make the constraint list at least somewhat shorter.
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()copilot-language Copilot.Language.Prelude 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.
mapMG :: (ModSummary -> ModSummary) -> ModuleGraph -> ModuleGraphghc-lib GHC Map a function f over all the ModSummaries. To preserve invariants f can't change the isBoot status.