
30 May
2011
30 May
'11
5:23 p.m.
On 30 May 2011 22:17, Stephen Tetley
On 30 May 2011 20:35, Christopher Howard
More specifically: Why is there a pipe symbol followed by what looks like a function definition in the "class" line?
It is a functional dependency.
Generally you can read it as "m uniquely determines e".
The simplest instance seems to be this one: instance (Error e) => MonadError e (Either e) where throwError = Left Left l `catchError` h = h l Right r `catchError` _ = Right r The functional dependency tells GHC that the error parameter 'e' is the same type variable 'e' that is in monad parameter '(Either e)'