[Haskell-cafe] Why Either = Left | Right instead of something like Result = Success | Failure

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Fri May 28 20:26:38 EDT 2010


Daniel Fischer <daniel.is.fischer at web.de> writes:
> But if you want to have
>
> instance Monad (Either ConcreteType) where ...
>
> , you can have
>
>     fail msg = Left someDefaultValue
>
> (or let the value depend on the message) and you can construct
> Left someMeaningfulValue in concrete situations.

Which happens to make it identical to Maybe ;-)

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list