darcs patch: Adding isLeft, isRight, fromLeft, fromRight,
splitEithers
Bulat Ziganshin
bulat.ziganshin at gmail.com
Tue Oct 31 06:20:04 EST 2006
Hello Ross,
Tuesday, October 31, 2006, 11:59:56 AM, you wrote:
> splitEithers (the Either counterpart of catMaybes) is a great idea.
> (Except maybe for the name; all these split's are getting confusing.)
> See also mapEither (the counterpart of mapMaybe) in Data.Map.
> I'm not so keen on isLeft, isRight, fromLeft and fromRight. Pattern
> matching is clearer and safer: at the point you make the decision, the
> type system has the extra information about the branch you've chosen.
> It also pushes the programmer to put the decision and the use of the data
> together, another good thing. The isJust/fromJust combination is already
> a rich source of bugs; we don't need more. (Same goes for null/head/tail,
> of course.)
nevertheless, we want to use them all :) "don't teach me a life,
just give some money :)"
--
Best regards,
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Libraries
mailing list