On Oct 3, 2006, at 03:49 , Ross Paterson wrote:
On Tue, Oct 03, 2006 at 10:44:49AM +1000, Thomas Conway wrote:
I've been [trying to] grapple with the various monads and
transformers, and it occurs to me that the standard instance for
Either as a monadic type is unnecessarily restrictive. Is
On Tue, Oct 03, 2006 at 07:52:54AM -0400, Lennart Augustsson wrote:
Yes, having fail in the Monad is a horrible wart.
And like some other warts in Haskell it was added to cure the symptom
rather than the disease. :(
Switching metaphors, what do you see as the disease in this case?
(As far as
Ross Paterson wrote:
On Tue, Oct 03, 2006 at 07:52:54AM -0400, Lennart Augustsson wrote:
Yes, having fail in the Monad is a horrible wart.
(As far as I know, it's there for the translation of pattern match
failure in do-expressions.)
I think it would be much less of a wart if the signature
It all came about because pattern matching failure sometimes cause a
do expression to be in MonadZero rather than Monad with the old
translation.
This gave rise to confusing error messages, it was claimed. This was
the disease.
-- Lennart
On Oct 3, 2006, at 08:28 , Ross Paterson
Hi All,
I've been [trying to] grapple with the various monads and
transformers, and it occurs to me that the standard instance for
Either as a monadic type is unnecessarily restrictive. Is there a
compelling reason that it is not just
instance Monad (Either e) where
return = Right
(Left