Proposal: Extensible exceptions

Yitzchak Gale gale at sefer.org
Mon Jul 7 16:42:05 EDT 2008


Henning Thielemann wrote:
>>> 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.

I wrote:
>> 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.

David Roundy wrote:
> It might help to clarify whether you're talking about IO.bracket and
> IO.catch or Control.Exception.bracket and Control.Exception.catch?

Oops, sorry, you're right. The primitive is block, not bracket.
More specifically, blockAsyncExceptions# and unblockAsyncExceptions#.
Those are used to implement block, which is used to
implement bracket, catch, etc.

-Yitzchak


More information about the Libraries mailing list