> 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 (Just
p)
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.
The operation may fail with:
ResourceExhausted
UnsupportedOperation