asynchronous exceptions

Marcin 'Qrczak' Kowalczyk qrczak at
Fri Apr 7 10:47:57 EDT 2006

"Simon Marlow" <simonmar at> writes:

> BTW, I just realised a better way to express block.  If block is
> supposed to count nesting, then we have a problem that you can still
> unblock exceptions even within a block by using sufficient number of
> unblocks, so the right way is to give block this type:
>   block :: ((IO b -> IO b) -> IO a) -> IO a

Or perhaps:
    block :: ((forall b. IO b -> IO b) -> IO a) -> IO a

It doesn't fit classic mutexes and conditions with my semantics of
implicit blocking, because condition wait should restore the blocking
state to the one before taking the mutex - but the condition wait is
written without explicit passing of any value from the point of taking
the mutex.

I'm not sure how it carries over to Haskell patterns though.

   __("<         Marcin Kowalczyk
   \__/       qrczak at

More information about the Haskell-prime mailing list