Proposal: System.Timeout module for base

Bulat Ziganshin bulat.ziganshin at
Thu Feb 1 05:49:23 EST 2007

Hello Simon,

Thursday, February 1, 2007, 12:46:29 PM, you wrote:

> Any other suggestions?

may be, we can raise exception in foreign language? at least for
'safe' calls. i.e., we establish in RTS signal handler. this handler
checks whether we are performing safe call and if so - raise
language-specific exception... hmm, if that's possible

btw, how about using for *Haskell* code *default* signal handler that
raise Haskell exception? i think that using signal handlers to process
OS-generated events is just legacy from the C days. i.e. 'main'
should be called by RTS inside code like this:

  mainThread <- myThreadId
  let onBreak event = do
        throwTo mainThread BreakException
  bracket (installHandler$ Catch onBreak) (installHandler) $  \oldHandler -> do

(of course, this handles only ^Break and only on Windows)

among other things, this should make signal handling portable between

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at

More information about the Libraries mailing list