[Haskell-cafe] how to catch keyboard interrupts?

Bulat Ziganshin bulat.ziganshin at gmail.com
Sat Feb 23 16:40:25 EST 2008

Hello Uwe,

Saturday, February 23, 2008, 11:35:35 PM, you wrote:

>> mysighandler =
>>   Catch (do hPutStrLn stderr "caught a signal!"
>>             fail "Interrupt!")

> scheme calculation doesn't get interrupted at all! I see in the
> System.Posix.Signals documentation that the signal handler gets
> invoked in a new thread; is this the source of the problem?

yes, fail kills only this thread :)

you should store thread id of thread running interpreter and send
async exception to it. control.concurrent is probably contains all
required functions

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list