Re: [Haskell-cafe] how to catch keyboard interrupts?

2008-02-24 Thread Ryan Ingram
This is pretty cool, but I have one warning: On Sat, Feb 23, 2008 at 4:37 PM, Uwe Hollerbach [EMAIL PROTECTED] wrote: data MyInterrupt = MyInt Int instance Typeable MyInterrupt where typeOf x = typeOf (0 :: Int) I am pretty sure that this makes Dynamic unsound; you could accidentally

Re: [Haskell-cafe] how to catch keyboard interrupts?

2008-02-24 Thread Uwe Hollerbach
Thanks, I'll try that. -- Uwe On 2/24/08, Ryan Ingram [EMAIL PROTECTED] wrote: This is pretty cool, but I have one warning: On Sat, Feb 23, 2008 at 4:37 PM, Uwe Hollerbach [EMAIL PROTECTED] wrote: data MyInterrupt = MyInt Int instance Typeable MyInterrupt where typeOf x =

[Haskell-cafe] how to catch keyboard interrupts?

2008-02-23 Thread Uwe Hollerbach
Hi, all, I am continuing to mess with my little scheme interpreter, and I decided that it would be nice to be able to hit control-C in the middle of a long-running scheme computation to interrupt that and return to the lisp prompt; hitting control-C and getting back to the shell prompt works, but

Re: [Haskell-cafe] how to catch keyboard interrupts?

2008-02-23 Thread Bulat Ziganshin
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

Re: [Haskell-cafe] how to catch keyboard interrupts?

2008-02-23 Thread Uwe Hollerbach
Thanks, Bulat, I'll look into this! On 2/23/08, Bulat Ziganshin [EMAIL PROTECTED] wrote: 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

Re: [Haskell-cafe] how to catch keyboard interrupts?

2008-02-23 Thread Uwe Hollerbach
On 2/23/08, Bulat Ziganshin [EMAIL PROTECTED] wrote: [about my question about keyboard interrupts] you should store thread id of thread running interpreter and send async exception to it. control.concurrent is probably contains all required functions Most splendid! Here's what I did