Proposal: Add isLeft/isRight to Data.Either

Gábor Lehel illissius at gmail.com
Wed Dec 5 09:13:44 CET 2012


+1 for maybeLeft/maybeRight too

On Tue, Dec 4, 2012 at 11:04 PM, Henning Thielemann
<lemming at henning-thielemann.de> wrote:
>
> On Tue, 4 Dec 2012, Herbert Valerio Riedel wrote:
>
>> btw, what I've been missing even more than isLeft/isRight is something
>> like
>>
>>         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.
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries



-- 
Your ship was destroyed in a monadic eruption.



More information about the Libraries mailing list