Proposal: Extensible exceptions

Yitzchak Gale gale at sefer.org
Mon Jul 7 09:54:51 EDT 2008


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


More information about the Libraries mailing list