
9 Nov
2006
9 Nov
'06
3:50 a.m.
On Fri, Nov 03, 2006 at 09:57:35AM -0500, roconnor@theorem.ca wrote:
I have attached a new patch to the trac that now uses the identifier partitionEithers.
I'd suggest also having the following variant, by analogy with mapMaybe: -- | Map values and separate the 'Left' and 'Right' results. mapEither :: (a -> Either b c) -> [a] -> ([b], [c]) mapEither f = foldr (add . f) ([], []) where add (Left b) (bs, cs) = (b:bs, cs) add (Right c) (bs, cs) = (bs, c:cs)