5.02 MonadError Broke My Code

Ashley Yakeley ashley@semantic.org
Sun, 21 Oct 2001 19:38:55 -0700


MonadError seems to have been redefined in 5.02 to have a fundep:

5.00.2:

    class (Monad m) => MonadError e m

5.02:

    class (Monad m) => MonadError e m | m -> e

Why? Perhaps the IO Monad can have only one kind or level of error, but 
why can't other Monads have more?

Anyway, because of GHC's naive instance overlapping checking, it broke my 
code:

    instance (JVMMonad m) => MonadError ThrowableRef m where
		      {
      		throwError = jvmThrow;
      		catchError = jvmCatch;
      		};

because GHC thinks it might overlap with the Prelude's

    instance MonadError Exception IO


-- 
Ashley Yakeley, Seattle WA