[Haskell-cafe] Why Either = Left | Right instead of something
like Result = Success | Failure
Thomas Davie
tom.davie at gmail.com
Thu May 27 10:56:47 EDT 2010
On 27 May 2010, at 15:25, Ionut G. Stan wrote:
> Hi,
>
> I was just wondering if there's any particular reason for which the two constructors of the Either data type are named Left and Right. I'm thinking that something like Success | Failure or Right | Wrong would have been a little better.
The reason I guess is that Success/Failure and Right/Wrong are a lot less general than Left/Right. One can use Either for types with two possible valid types contained within, it doesn't only have to be used for types where one is for "correct" results and the other for "erroneous".
Of course, there's nothing stopping you implementing your own type :)
Bob
More information about the Haskell-Cafe
mailing list