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.

  1. mapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m ()) -> mono -> m ()

    mono-traversable Data.MonoTraversable.Unprefixed

    Synonym for omapM_

  2. mapNonNull :: (Functor f, MonoFoldable (f b)) => (a -> b) -> NonNull (f a) -> NonNull (f b)

    mono-traversable Data.NonNull

    fmap over the underlying container in a NonNull.

  3. mapToDecoder :: (b -> a) -> Codec context any b -> Codec context Void a

    autodocodec Autodocodec

    Map a codec for decoding bs into a decoder for as. This is useful for building discriminatedUnionCodecs.

  4. 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.

  5. 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
    

  6. mapToDecoder :: (b -> a) -> Codec context any b -> Codec context Void a

    autodocodec Autodocodec.Codec

    Map a codec for decoding bs into a decoder for as. This is useful for building discriminatedUnionCodecs.

  7. 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.

  8. mapBoth :: (a -> c) -> (b -> d) -> Either a b -> Either c d

    either 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
    

  9. mapLeft :: (a -> c) -> Either a b -> Either c b

    either 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"
    

  10. mapRight :: (b -> c) -> Either a b -> Either a c

    either 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
    

Page 122 of many | Previous | Next