
31 Oct
2006
31 Oct
'06
7:17 a.m.
On Tue, 31 Oct 2006, Bulat Ziganshin wrote:
It'd be nice to have the following, too:
lefts :: [Either a b] -> [a] lefts = fst . splitEithers rights :: [Either a b] -> [b] rights = snd . splitEithers
i think that this may be faster:
lefts = filter isLeft rights = filter isRight
filter isLeft produces the wrong type. I believe the correct definition is: lefts x = [a | (Left a) <- x] rights x = [a | (Right a) <- x] -- 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.''