
30 Jun
2010
30 Jun
'10
11:44 a.m.
On Wed, 30 Jun 2010, Tyson Whitehead wrote:
Perhaps it could be pushed it into it's own type class, which would then required by the do notation? Exactly like mdo required MonadFix. I understand there was one called MonadZero for this at some time?
I assume that there is no need to change the compiler, just the library, or even just the imports, since GHC will simply insert 'fail' where necessary and this automatically introduces the type class constraints that 'fail' has. If a custom 'fail' from a new MonadError class is in scope, then MonadError will be required for the whole expression that a 'do' block represents.