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.
mapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m ()) -> mono -> m ()mono-traversable Data.MonoTraversable.Unprefixed Synonym for omapM_
mapNonNull :: (Functor f, MonoFoldable (f b)) => (a -> b) -> NonNull (f a) -> NonNull (f b)mono-traversable Data.NonNull mapToDecoder :: (b -> a) -> Codec context any b -> Codec context Void aautodocodec Autodocodec Map a codec for decoding bs into a decoder for as. This is useful for building discriminatedUnionCodecs.
mapToEncoder :: b -> Codec context b any -> Codec context a ()autodocodec Autodocodec Wrap up a value of type b with its codec to produce and encoder for as that ignores its input and instead encodes the value b. This is useful for building discriminatedUnionCodecs.
mapCodec :: (Ord k, FromJSONKey k, ToJSONKey k) => JSONCodec v -> JSONCodec (Map k v)autodocodec Autodocodec.Codec Encode a Map, and decode any Map.
API Note
This is a forward-compatible version of MapCodec.mapCodec = MapCodec
mapToDecoder :: (b -> a) -> Codec context any b -> Codec context Void aautodocodec Autodocodec.Codec Map a codec for decoding bs into a decoder for as. This is useful for building discriminatedUnionCodecs.
mapToEncoder :: b -> Codec context b any -> Codec context a ()autodocodec Autodocodec.Codec Wrap up a value of type b with its codec to produce and encoder for as that ignores its input and instead encodes the value b. This is useful for building discriminatedUnionCodecs.
mapBoth :: (a -> c) -> (b -> d) -> Either a b -> Either c deither Data.Either.Combinators The mapBoth function takes two functions and applies the first if iff the value takes the form Left _ and the second if the value takes the form Right _. Using Data.Bifunctor:
mapBoth = bimap
Using Control.Arrow:mapBoth = (+++)
>>> mapBoth (*2) (*3) (Left 4) Left 8
>>> mapBoth (*2) (*3) (Right 4) Right 12
mapLeft :: (a -> c) -> Either a b -> Either c beither Data.Either.Combinators The mapLeft function takes a function and applies it to an Either value iff the value takes the form Left _. Using Data.Bifunctor:
mapLeft = first
Using Control.Arrow:mapLeft = (left)
Using Control.Lens:mapLeft = over _Left
>>> mapLeft (*2) (Left 4) Left 8
>>> mapLeft (*2) (Right "hello") Right "hello"
mapRight :: (b -> c) -> Either a b -> Either a ceither Data.Either.Combinators The mapRight function takes a function and applies it to an Either value iff the value takes the form Right _. Using Data.Bifunctor:
mapRight = second
Using Control.Arrow:mapRight = (right)
Using Control.Lens:mapRight = over _Right
>>> mapRight (*2) (Left "hello") Left "hello"
>>> mapRight (*2) (Right 4) Right 8