Often, Either is used to represent, exclusively, a value or a failure, in a more detailed way than Maybe can. For example, a function like `parse` (http://hackage.haskell.org/packages/archive/parsec/latest/doc/html/Text-Parsec-Prim.html#v:parse), which is part of Parsec, might have a type like:

parse :: [...] s -> Either ParseError a

Meaning, parsing will either fail with a Left ParseError, or succeed with a Right a, where a is whatever type your parser returns.

Hope that helps,

Alvaro





On Wed, Feb 6, 2013 at 9:37 PM, Jacob Thomas <jthomas7@ucsc.edu> wrote:

Hello 

I'm new to Haskell, and need help with figuring out the Either type...
Any example to show how this works?

Jacob


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe