Proposal: Add isLeft/isRight to Data.Either
Edward Kmett
ekmett at gmail.com
Sat Dec 1 00:03:18 CET 2012
You can add lens to the list of packages that had to define their own (for
doctest purposes). ;)
On Fri, Nov 30, 2012 at 6:02 PM, Edward Kmett <ekmett at gmail.com> wrote:
> +1
>
> On Fri, Nov 30, 2012 at 3:38 PM, Simon Hengel <sol at typeful.net> wrote:
>
>> Hi,
>> I propose to add isLeft/isRight to Data.Either, with the obvious
>> definitions:
>>
>> isLeft :: Either a b -> Bool
>> isLeft (Left _) = True
>> isLeft (Right _) = False
>>
>> isRight :: Either a b -> Bool
>> isRight (Left _) = False
>> isRight (Right _) = True
>>
>> There has been a discussion on that before [1]. While I agree that
>> fromLeft/fromRight are moot, I don't see issues with isLeft/isRight.
>>
>> Personally I care mostly about isLeft, but for orthogonality I propose
>> to add both isLeft and isRight.
>>
>> Here is a (possibly incomplete) list of packages that come with their
>> own definition of isLeft:
>>
>> snap-core, multifocal, PriorityChansConverger, tamarin-prover-utils,
>> Agda, PCLT, cmdtheline, scyther-proof, xmlhtml, hspec-expectations,
>> Glob, language-glsl, Craft3e, hledger-lib, narc, nemesis,
>> type-settheory, PCLT-DB, RJson, bio, errors, rss2irc, heist
>>
>> Discussion period: 2 Weeks
>>
>> Cheers,
>> Simon
>>
>> [1] http://www.haskell.org/pipermail/libraries/2006-October/006098.html
>>
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20121130/b202a464/attachment.htm>
More information about the Libraries
mailing list