Hoogle Search
Within LTS Haskell 24.33 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapFB :: (elt -> lst -> lst) -> (a -> elt) -> a -> lst -> lstghc-internal GHC.Internal.Base No documentation available.
mapM :: Monad m => (a -> m b) -> [a] -> m [b]ghc-internal GHC.Internal.Base mappend :: Monoid a => a -> a -> aghc-internal GHC.Internal.Base 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.
mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> aghc-internal GHC.Internal.Control.Exception This function maps one exception into another as proposed in the paper "A semantics for imprecise exceptions".
mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> aghc-internal GHC.Internal.Control.Exception.Base This function maps one exception into another as proposed in the paper "A semantics for imprecise exceptions".
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])ghc-internal GHC.Internal.Control.Monad The mapAndUnzipM function maps its first argument over a list, returning the result as a pair of lists. This function is mainly used with complicated data structures or a state monad.
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)ghc-internal GHC.Internal.Control.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.mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()ghc-internal GHC.Internal.Control.Monad 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.
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()ghc-internal GHC.Internal.Data.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.
mapAccumL :: Traversable t => (s -> a -> (s, b)) -> s -> t a -> (s, t b)ghc-internal GHC.Internal.Data.List The mapAccumL function behaves like a combination of fmap and foldl; it applies a function to each element of a structure, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new structure.
Examples
Basic usage:>>> mapAccumL (\a b -> (a + b, a)) 0 [1..10] (55,[0,1,3,6,10,15,21,28,36,45])
>>> mapAccumL (\a b -> (a <> show b, a)) "0" [1..5] ("012345",["0","01","012","0123","01234"])