
1 Nov
2009
1 Nov
'09
2:21 p.m.
On Sun, Nov 1, 2009 at 5:32 PM, Michael Mossey
On the other hand, if you added
instance (Error e) => MonadError String (Either e)
and didn't include the functional dependency, the compiler would still run into a problem with overlapping instances and have no way to decide, which I presume is still an error.
Right, in this case it is true, but supposing the MonadError instance for Either was rather :
instance (Error e) => MonadError (Maybe String) (Either e)
There would be nothing a priori that would prevent you from writing another instance :
instance (Error e) => MonadError String (Either e)
There are a certain number of case where this functional constraint is thus useful. -- Jedaï