Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

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

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

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

  4. mapException :: (e0 -> e1) -> Exceptional e0 a -> Exceptional e1 a

    explicit-exception Control.Monad.Exception.Asynchronous.Lazy

    No documentation available.

  5. mapExceptionT :: forall (m :: Type -> Type) e0 e1 a . Monad m => (e0 -> e1) -> ExceptionalT e0 m a -> ExceptionalT e1 m a

    explicit-exception Control.Monad.Exception.Asynchronous.Lazy

    No documentation available.

  6. mapExceptional :: (e0 -> e1) -> (a -> b) -> Exceptional e0 a -> Exceptional e1 b

    explicit-exception Control.Monad.Exception.Asynchronous.Lazy

    No documentation available.

  7. mapExceptionalT :: (m (Exceptional e0 a) -> n (Exceptional e1 b)) -> ExceptionalT e0 m a -> ExceptionalT e1 n b

    explicit-exception Control.Monad.Exception.Asynchronous.Lazy

    No documentation available.

  8. mapM :: Monad m => (a -> m b) -> Exceptional e a -> m (Exceptional e b)

    explicit-exception Control.Monad.Exception.Asynchronous.Lazy

    No documentation available.

  9. mapException :: (e0 -> e1) -> Exceptional e0 a -> Exceptional e1 a

    explicit-exception Control.Monad.Exception.Asynchronous.Strict

    No documentation available.

  10. mapExceptionT :: forall (m :: Type -> Type) e0 e1 a . Monad m => (e0 -> e1) -> ExceptionalT e0 m a -> ExceptionalT e1 m a

    explicit-exception Control.Monad.Exception.Asynchronous.Strict

    No documentation available.

Page 122 of many | Previous | Next