[GHC] #974: Add isLeft, isRight, fromLeft, fromRight, and splitEithers to Data.Either

roconnor at theorem.ca roconnor at theorem.ca
Tue Oct 31 02:34:48 EST 2006


>>> This proposal would add basic functionality to `Either` similar to that
>>> for `Maybe`.  The `splitEithers` function of type `[Either a b] ->
>>> ([a],[b])` is unique; however, it seems to be a widely useful function.
>>
>> This (in my mind) is a parallel to unzip? unzipEithers to me gives a
>> much clearer picture of what is going on here.
>
> yeah, if its an unzip, then unzipEithers makes more sense.

The function strikes me as more like an instance of partition than unzip. 
I would be satisfied with either splitEithers, unzipEithers, or 
partitionEithers.  My preferences are in that order (partitionEithers 
seems like an awfully long identifier).

-- 
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''


More information about the Libraries mailing list