[Haskell-cafe] Error Monad and strings
gcross at phys.washington.edu
Tue Jul 27 18:49:42 EDT 2010
It is for the very annoying reason that in order for Error to be a monad
it has to implement the "fail" method, which means it has to know how to
turn an arbitrary string into a value of your error type.
On 07/27/10 15:32, Gerald Gutierrez wrote:
> Reading the Control.Monad.Error documentation, I see that the Error
> class has noMsg and strMsg as its only two functions.
> Now, I understand that you can define your own Error instances such as
> in example 1 of the documentation, so why the need to always support
> strings via noMsg/strMsg ? What uses these? And if in my code, I will
> never throw an error with a string, am I supposed to implement these
> functions and then ignore them?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe