[Haskell-cafe] Combine `StateT` and `InputT` to maintain state on Ctrl-C interrupt

haskell at stefan-klinger.de haskell at stefan-klinger.de
Wed Aug 12 15:59:03 UTC 2015

On 2015-Aug-12, mikael.brockman at gmail.com wrote with possible deletions:
> But could one get away with using `handle` at the particular sites where
> one expects to be interrupted, e.g. around the call to `threadDelay`?

Yeah, I've had that, but I don't like it: When the user's wetware
decides that somethig takes longer than expected, it decides to press
Ctrl-C.  Now the calculation might just terminate an instant before
the keypress, yielding a race condition between whether the interrupt
is caught, or not (or by which exception handler).  Also, pressing C-c
(un)intentionally at the prompt would either terminate the program, or
reset all settings made in the interactive session, thats way more
than I'd like to happen.

But thanks for the idea...

http://stefan-klinger.de                                      o/X

More information about the Haskell-Cafe mailing list