Installing a top-level handler on an existing thread

24 Jan
2011
24 Jan
'11
8:02 a.m.
I've been toying with a little thread manager library, and for sanity's sake I really need a way to install another top-level exception handler on an existing thread. I don't want to replace any other handlers, just put my own handler around the thread's continuation. Of course, it would be pretty easy to do if the IO monad had a nice efficient implementation of call/cc and call/cc1, although I don't need the full power of continuations. I really don't want to create my own "Thread" monad (which could use ContT), I want to be able to do it on plain old IO threads. Is there any way to do this in GHC? Best, Leon
5231
Age (days ago)
5231
Last active (days ago)
0 comments
1 participants
participants (1)
-
Leon Smith