
#1171: GHC doesn't respect the imprecise exceptions semantics -------------------------------+-------------------------------------------- Reporter: neil | Owner: Type: bug | Status: new Priority: low | Milestone: _|_ Component: Compiler | Version: 6.6 Resolution: | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: cg059 | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Comment(by simonpj): Simon PJ and Simon M also discussed `throwIO`, which is a bit more preditable than `throw`. Specifically: {{{ throw e `seq` x ===> throw e throwIO e `seq` x ===> x }}} However, `throwIO` currently is still just as strict as `throw`. For example: {{{ f :: (Int,Int) -> IO a f x = throwIO (ErrorCall "urk") main = throwIO (error "yes") }}} This will throw `(error "yes")` because `throwIO` evaluates (but doesn't unbox) its argument because `throwIO` is strict. We could artificially make `throwIO` appear not to diverge, even when given two arguments (ie including the state token). That would have a much less bad effect than making `error` or `throw` appear not to diverge; and would make `throwIO` still more predictable, but I don't know how large the effect would be. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1171#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler