On 24-Jun-2000, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> wrote:
> When an Either result encodes a good result or an error, the error
> should be Left and the good result should be Right. Rationale:
> partially applied type is a good Functor and Monad. Seems to be
> consistently used (MonadEither, Parsec).
Actually I dislike this practice of using `Either' for something which
is either a good result or an error. In this case, there is an
assymetry in the meaning we attach to the two cases. Using `Left' and
`Right' for such cases is fundamentally confusing since it is not
clear what the meaning of `Left' and `Right' is. I much prefer using
a separate type defined as e.g.
data Result error val = ResultError error | ResultOK val
This tends to lead to much more readable code.
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED] | -- the last words of T. S. Garp.