[GHC] #11778: Preserve demandInfo on lambda binders in the simpifier

GHC ghc-devs at haskell.org
Thu Mar 31 17:17:42 UTC 2016


#11778: Preserve demandInfo on lambda binders in the simpifier
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nomeata):

 Just to confirm my understanding:

 Looking at the code, it seems the same effect could be achieved with less
 code change by changing
 {{{
     need_to_zap = any zappable_bndr (drop n_args bndrs)
     n_args = countArgs cont
 }}}
 to
 {{{
     need_to_zap = n_args > 0 && any zappable_bndr (drop n_args bndrs)
     n_args = countArgs cont
 }}}
 because the problem only occurs if there is some, but not enough beta-
 reduction. In particular, when simplifying the definition, `n_args` will
 be zero.

 (I’m not saying that this is a better implementation. But maybe it is, as
 it is more local.)

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


More information about the ghc-tickets mailing list