Proposal: Add isLeft/isRight to Data.Either
lemming at henning-thielemann.de
Tue Dec 4 23:04:43 CET 2012
On Tue, 4 Dec 2012, Herbert Valerio Riedel wrote:
> btw, what I've been missing even more than isLeft/isRight is something
> leftMaybe :: Either a b -> Maybe a
> leftMaybe (Left x) = Just x
> leftMaybe _ = Nothing
> rightMaybe :: Either a b -> Maybe b
> rightMaybe (Right x) = Just x
> rightMaybe _ = Nothing
These seem to be more useful for me than isLeft and isRight.
However, I think I would prefer maybeLeft and maybeRight.
More information about the Libraries