[Haskell-cafe] Printing of asynchronous exceptions to stderr

Simon Marlow marlowsd at gmail.com
Wed Nov 17 06:00:48 EST 2010

On 12/11/2010 07:49, Mitar wrote:

> On Wed, Nov 10, 2010 at 4:48 PM, Simon Marlow<marlowsd at gmail.com>  wrote:
>> You can use maskUninterruptible in GHC 7, but that is not generally
>> recommended,
> Maybe there should be some function like maskUninterruptibleExceptUser
> which would mask everything except UserInterrupt exception. Or maybe
> UserInterrupt and some additional exception meant for use by programs,
> like InterruptMaskException.

That's hard to do, because the runtime system has no knowledge of 
exception types, and I'm not sure I like the idea of baking that 
knowledge into the RTS.

Furthermore I'm not sure about the usefulness of 
maskUninterruptibleExceptUser - it seems even less useful than 
maskUninterruptible to me.  The point of maskUninterruptible is for 
those hoefully rare rare cases where (a) it's really inconvenient to 
deal with async exceptions and (b) you have some external guarantee that 
the critical section won't block.

> Or we could make two new type classes:
> HiddenException -- for those exceptions which should not print
> anything if not caught

We could do that (or something like it), yes.

> UninterruptibleExceptException -- for those exceptions which should
> not be masked with maskUninterruptibleExcept function

but not this (see above).


More information about the Glasgow-haskell-users mailing list