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.
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
mapException :: (e0 -> e1) -> Exceptional e0 a -> Exceptional e1 aexplicit-exception Control.Monad.Exception.Asynchronous.Lazy No documentation available.
-
explicit-exception Control.Monad.Exception.Asynchronous.Lazy No documentation available.
mapExceptional :: (e0 -> e1) -> (a -> b) -> Exceptional e0 a -> Exceptional e1 bexplicit-exception Control.Monad.Exception.Asynchronous.Lazy No documentation available.
-
explicit-exception Control.Monad.Exception.Asynchronous.Lazy No documentation available.
mapM :: Monad m => (a -> m b) -> Exceptional e a -> m (Exceptional e b)explicit-exception Control.Monad.Exception.Asynchronous.Lazy No documentation available.
mapException :: (e0 -> e1) -> Exceptional e0 a -> Exceptional e1 aexplicit-exception Control.Monad.Exception.Asynchronous.Strict No documentation available.
-
explicit-exception Control.Monad.Exception.Asynchronous.Strict No documentation available.