Safe Haskell | Safe-Inferred |
---|
Functions for dealing with Either values.
- module Data.Either
- mapEither :: (a -> b1) -> (b -> b2) -> Either a b -> Either b1 b2
- mapLeft :: (a -> b1) -> Either a b2 -> Either b1 b2
- mapRight :: (b -> b2) -> Either b1 b -> Either b1 b2
- leftToMaybe :: Either a b -> Maybe a
- rightToMaybe :: Either a b -> Maybe b
- isLeft :: Either a b -> Bool
- isRight :: Either a b -> Bool
- fromLeft :: a -> Either a b -> a
- fromRight :: b -> Either a b -> b
- whenRight :: Monad m => Either a b -> (b -> m c) -> m ()
- whenLeft :: Monad m => Either a b -> (a -> m c) -> m ()
Documentation
module Data.Either
leftToMaybe :: Either a b -> Maybe aSource
Maybe get the left side of an Either.
rightToMaybe :: Either a b -> Maybe bSource
Maybe get the right side of an Either.