
5 Dec
2012
5 Dec
'12
9:29 a.m.
On Mittwoch, 5. Dezember 2012, 09:23:31, Simon Hengel wrote:
Hi Herbert,
On Tue, Dec 04, 2012 at 11:02:07PM +0100, 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
There seems to be support for this. I think it would be useful to have a separate proposal/patch.
I'm not against it, but I would like to ask whether these are really used so frequently that Prelude> :t either Just (const Nothing) either Just (const Nothing) :: Either a b -> Maybe a is too cumbersome.