[GHC] #15143: Passing an IO value through several functions results in program hanging.

GHC ghc-devs at haskell.org
Fri May 18 03:08:50 UTC 2018


#15143: Passing an IO value through several functions results in program hanging.
-------------------------------------+-------------------------------------
        Reporter:  Burtannia         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Burtannia):

 Replying to [comment:6 simonpj]:

 First of all I'm very excited that you replied to this. Your financial
 contracts paper was of great interest and your talk(s) on writing a good
 dissertation / paper were a huge help! So thank you for those.

 Anyway, back to the issue at hand...

 > Each call of `incTime` invokes its argument `o` twice.

 After thinking through this for a while I think I understand what's
 happening. `o` is being evaluated both in `obs <- o` and with `_ -> o`? I
 wasn't thinking of `o` as a monadic computation and therefore I thought of
 `_ -> o` as just returning the input unchanged rather than evaluating it
 again.

 > {{{
 > incTime (do { updRef r (+ 1); return ObsTemp })
 > }}}

 I don't understand this example. What is `updRef` and what value is
 `ObsTemp` wrapping? Not that it matters because I agree that the observed
 behaviour with `incTime` is not a bug.

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


More information about the ghc-tickets mailing list