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.
mapMB :: (Int -> Int) -> Approx -> Approxcdar-mBound Data.CDAR.Approx No documentation available.
mapMC :: Monad m => (a -> m b) -> ConduitT a b m ()classy-prelude-conduit ClassyPrelude.Conduit Apply a monadic transformation to all values in a stream. If you do not need the transformed values, and instead just want the monadic side-effects of running the action, see mapM_.
mapMCE :: (Monad m, Traversable f) => (a -> m b) -> ConduitT (f a) (f b) m ()classy-prelude-conduit ClassyPrelude.Conduit Apply a monadic transformation to all elements in a chunked stream.
mapM_C :: Monad m => (a -> m ()) -> ConduitT a o m ()classy-prelude-conduit ClassyPrelude.Conduit 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-conduit ClassyPrelude.Conduit 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 :: Filtrable f => (a -> Maybe b) -> f a -> f bfiltrable Data.Filtrable Map the container with the given function, dropping the elements for which it returns Nothing.
mapMaybeA :: (Filtrable f, Traversable f, Applicative p) => (a -> p (Maybe b)) -> f a -> p (f b)filtrable Data.Filtrable Traverse the container with the given function, dropping the elements for which it returns Nothing.
mapMaybe :: (a -> Maybe b) -> [a] -> [b]incipit-base Incipit.Base 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]
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()incipit-base Incipit.Foldable 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.
-
incremental-parser Text.ParserCombinators.Incremental Converts a parser accepting one input type to another, just like 'mapMaybeInput except the two argument functions can demand more input by returning Nothing. If 'mapMaybeInput is defined for the two input inputs, then
mapInput f g == mapMaybeInput (Just . f) (Just . g)