Hoogle Search
Within LTS Haskell 24.19 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapWithKey :: (k -> a -> b) -> Map k a -> Map k bcontainers Data.Map.Strict.Internal Map a function over all values in the map.
let f key x = (show key) ++ ":" ++ x mapWithKey f (fromList [(5,"a"), (3,"b")]) == fromList [(3, "3:b"), (5, "5:a")]
mapWithIndex :: (Int -> a -> b) -> Seq a -> Seq bcontainers Data.Sequence A generalization of fmap, mapWithIndex takes a mapping function that also depends on the element's index, and applies it to every element in the sequence.
mapWithIndex :: (Int -> a -> b) -> Seq a -> Seq bcontainers Data.Sequence.Internal A generalization of fmap, mapWithIndex takes a mapping function that also depends on the element's index, and applies it to every element in the sequence.
mapMonotonic :: (a -> b) -> Set a -> Set bcontainers Data.Set The mapMonotonic f s == map f s, but works only when f is strictly increasing. The precondition is not checked. Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls] ==> mapMonotonic f s == map f s where ls = toList s
mapMonotonic :: (a -> b) -> Set a -> Set bcontainers Data.Set.Internal The mapMonotonic f s == map f s, but works only when f is strictly increasing. The precondition is not checked. Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls] ==> mapMonotonic f s == map f s where ls = toList s
mapLift :: (f a -> g a) -> Lift f a -> Lift g atransformers Control.Applicative.Lift Apply a transformation to the other computation.
mapAccum :: ((a, w) -> (b, w)) -> Accum w a -> Accum w btransformers Control.Monad.Trans.Accum Map both the return value and output of a computation using the given function.
mapAccumT :: (m (a, w) -> n (b, w)) -> AccumT w m a -> AccumT w n btransformers Control.Monad.Trans.Accum Map both the return value and output of a computation using the given function.
mapCont :: (r -> r) -> Cont r a -> Cont r atransformers Control.Monad.Trans.Cont Apply a function to transform the result of a continuation-passing computation.
mapExcept :: (Either e a -> Either e' b) -> Except e a -> Except e' btransformers Control.Monad.Trans.Except Map the unwrapped computation using the given function.