[GHC] #13406: IO hack in demand analyzer can miss I/O

GHC ghc-devs at haskell.org
Fri Mar 10 00:02:56 UTC 2017


#13406: IO hack in demand analyzer can miss I/O
-------------------------------------+-------------------------------------
           Reporter:  dfeuer         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.4.1
          Component:  Compiler       |           Version:  8.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Other
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 If someone digs into the `IO` type, they could (with good reason, even!)
 decide that they want to produce something other than an unboxed pair.
 Here's an example, imitating `StateT st IO a` in a way that's sure to be
 unboxed well:

 {{{#!hs
 newtype IOState st a = IOState
   { unIOState :: State# RealWorld
               -> st
               -> (# State# RealWorld, st, a #) }
 }}}

 This won't trip `io_hack_reqd`, so demand analysis won't see it as I/O,
 and everything will be wrong. Urk. Furthermore, in the future, we may
 allow newtypes around unlifted types, in which case this stuff gets even
 messier.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13406>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list