Proposal: Add Control.Exception.allowInterrupt

Simon Marlow marlowsd at
Wed Dec 22 11:37:55 CET 2010


This proposal is to add the following function to Control.Exception:

-- | When invoked inside 'mask', this function allows a blocked
-- asynchronous exception to be raised, if one exists.  It is
-- equivalent to performing an interruptible operation (see
-- #interruptible#), but does not involve any actual blocking.
-- When called outside 'mask', or inside 'uninterruptibleMask', this
-- function has no effect.
allowInterrupt :: IO ()
allowInterrupt = unsafeUnmask $ return ()

The above is almost the entire implementation modulo imports, so I 
didn't bother attaching a patch to the ticket.  unsafeUnmask is not 
exported by Control.Exception, it is an internal function from GHC.IO.

Some discussion leading up to this can be found in

Discussion period: 3 weeks (until 12 Jan 2011)


More information about the Libraries mailing list