
#13330: forkIO has inconsistent behavior under optimization -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: dfeuer Type: bug | Status: patch Priority: normal | Milestone: 8.2.1 Component: Core Libraries | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3189 Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): It looks to me like the original work behind trying to be extra-clever about `catchException` demand analysis might be recoverable. Fundamentally, this has very little to do with `catch#` per se. The primop it suggests is a sort of `forceIO :: (State# s -> (# State# s, a)) -> (State# s -> (# State# s, a))`. The intuition behind this primop is that it reduces an `IO` action to something with precisely the form {{{#!hs \s -> case PRIMOP s of (# s', ... #) -> e }}} I don't know if this is actually implementable, but I think it's probably what all that fanciness in `Demand.hs` was trying to get at. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13330#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler