
7 Jul
2008
7 Jul
'08
9:54 a.m.
Henning Thielemann wrote:
Exception handling should be done with an ErrorT monad transformer... This should be implemented on top of existing IO...
I wrote:
Unfortunately, that is not possible currently. There are primitives, such as "bracket", that do not support this.
I don't see the problem. Current 'bracket' would be used for bracketing current IO code, new 'bracket' would be used to bracket new ErrorT based IO code.
bracket is a GHC primitive. It works only directly with IO, not with other monads. I don't think there is any way to write "new bracket" right now. bracket is an essential part of exception handling. It is built in to the definition of catch. Regards, Yitz