[GHC] #1171: GHC doesn't respect the imprecise exceptions semantics
GHC
cvs-ghc at haskell.org
Wed Feb 13 17:34:45 CET 2013
#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
More information about the ghc-tickets
mailing list