[GHC] #8091: retry# lacks strictness information

GHC ghc-devs at haskell.org
Thu Jul 25 08:22:00 CEST 2013


#8091: retry# lacks strictness information
-------------------------------------+------------------------------------
        Reporter:  parcs             |            Owner:
            Type:  bug               |           Status:  patch
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.6.3
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by simonpj):

 I like the idea, but it does have strictness consequences too.  For
 example:
 {{{
 f :: TVar Int -> Int -> STM Int
 f r y = do { v <- readTVar r
            ; if v>0 then retry
                     else if y>0 then return 0 else return y
            }
 }}}
 I have not checked but I think this will not be strict in y because the
 `then` branch doesn't evaluate y.  With your change it'll become strict in
 y, just as it would if you replace `retry` with `throw exn`.  I think
 that's probably fine, and no one will even notice; just saying.

 Simon

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




More information about the ghc-tickets mailing list