5 Jan
2009
5 Jan
'09
4:55 p.m.
On Mon, 5 Jan 2009, Luke Palmer wrote:
Oh bother! My new year's resolution: think before I speak.
While I do think this is the right answer, it is not the right answer in the status quo. This is because ErrorT e m is only a monad when e is an Error, which Either (and most types) are not. It will be the right answer when fail is factored out of Monad into MonadFail (which will happen someday hopefully), because then the typechecker will verify that the above composition cannot fail.
But now I can't think of a good answer. Darn.
In the explicit-exception package I omit 'fail' and allow an exception type without constraints.