Asynchronous exception wormholes kill modularity

Bas van Dijk v.dijk.bas at
Thu Mar 25 19:16:52 EDT 2010

On Thu, Mar 25, 2010 at 11:23 PM, Simon Marlow <marlowsd at> wrote:
>> So I'm all for deprecating 'block' in favor of 'mask'. However what do
>> we call 'unblock'? 'unmask' maybe? However when we have:
>> mask $ mask $ unmask x
>> and these operations have the counting nesting levels semantics,
>> asynchronous exception will not be unmasked in 'x'. However I don't
>> currently know of a nicer alternative.
> But that's the semantics you wanted, isn't it?  Am I missing something?

Yes I like the nesting semantics that Twan proposed.

But with regard to naming, I think the name 'unmask' is a bit
misleading because it doesn't unmask asynchronous exceptions. What it
does is remove a layer of masking so to speak. I think the names of
the functions should reflect the nesting or stacking behavior. Maybe
something like:

addMaskingLayer :: IO a -> IO a
removeMaskingLayer :: IO a -> IO a
nrOfMaskingLayers :: IO Int

However I do find those a bit long and ugly...



More information about the Libraries mailing list