[Prev] [Up] [Next]


User Interrupt Handling "LibUserInterrupt"


> interface LibUserInterrupt where

> setUserInterrupt :: Maybe (IO ()) -> IO (Maybe (IO ()))

Whenever a user interrupt occurs, the program is stopped. If an interrupt handler is installed, this is then executed in place of the program. If no interrupt handler is installed, the program is simply terminated.

Computation setUserInterrupt (Justp) installs p as the interrupt handler; Computation setUserInterrupt Nothing removes the current interrupt handler. In either case, if an interrupt handler q was previously installed (Just q) is returned; otherwise Nothing is returned. (Rationale)

The operation may fail with:


[Prev] [Up] [Next]


The Definition of Monadic I/O in Haskell 1.3
Haskell 1.3 Committee
haskell1.3@comp.vuw.ac.nz