
Hi Bulat, I wrote:
...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.
Bulat Ziganshin wrote:
actually it's a catch# used to implement catch used for everything else.
Yes, there is also that primitive that is only for IO. I don't remember this moment whether it might be possible to work around this one.
primitives you are mentioned only enable/disable delivering of async exceptions
Yes, and they are critical for catch to avoid deadlock. For this, I didn't find any workaround for the current primitives. If instead we had startBlocking :: IO () stopBlocking :: IO () then we could implement block for other monads. At the time, Simon Marlow wrote that this could be done, but that we would lose out on a certain optimization. Regards, Yitz