Re: [Haskell-cafe] ANNOUNCE: control-monad-failure and safe-failure

Michael Snoyman schrieb:
control-monad-failure provides a basic notion of failure which does not commit to any concrete representation. It is just a version of the MonadError class without the annoying bits.
class MonadFailure e m where failure :: e -> m a
Why is it called "MonadFailure" (specifically, what's the "Monad" bit doing there)?

Excerpts from Kalman Noel's message of Tue Nov 17 07:47:14 +0100 2009:
Michael Snoyman schrieb:
control-monad-failure provides a basic notion of failure which does not commit to any concrete representation. It is just a version of the MonadError class without the annoying bits.
class MonadFailure e m where failure :: e -> m a
Why is it called "MonadFailure" (specifically, what's the "Monad" bit doing there)?
Because of 'Monad m' being a superclass of 'MonadFailure e m'. Here is the class: class Monad m => MonadFailure e m where failure :: e -> m a -- Nicolas Pouillard http://nicolaspouillard.fr

Nicolas Pouillard schrieb:
class MonadFailure e m where failure :: e -> m a Why is it called "MonadFailure" (specifically, what's the "Monad" bit doing there)?
Because of 'Monad m' being a superclass of 'MonadFailure e m'.
Here is the class: class Monad m => MonadFailure e m where failure :: e -> m a
Oh ok; I misguidedly took the line at the top to be the class definition. I'd still be interested if such a simple Failure class could be meaningful or useful for mere, say, Applicatives.

Excerpts from Kalman Noel's message of Tue Nov 17 12:55:54 +0100 2009:
Nicolas Pouillard schrieb:
class MonadFailure e m where failure :: e -> m a Why is it called "MonadFailure" (specifically, what's the "Monad" bit doing there)?
Because of 'Monad m' being a superclass of 'MonadFailure e m'.
Here is the class: class Monad m => MonadFailure e m where failure :: e -> m a
Oh ok; I misguidedly took the line at the top to be the class definition. I'd still be interested if such a simple Failure class could be meaningful or useful for mere, say, Applicatives.
I think it is meaningful. -- Nicolas Pouillard http://nicolaspouillard.fr
participants (2)
-
Kalman Noel
-
Nicolas Pouillard