[GHC] #10595: BuiltinRules override other rules in some cases.

GHC ghc-devs at haskell.org
Mon Jul 27 13:47:55 UTC 2015


#10595: BuiltinRules override other rules in some cases.
-------------------------------------+-------------------------------------
        Reporter:  gjsimms           |                   Owner:
            Type:  bug               |                  Status:  closed
        Priority:  high              |               Milestone:
       Component:  Compiler          |                 Version:  7.11
      Resolution:  invalid           |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by Simon Peyton Jones <simonpj@…>):

 In [changeset:"2d88a531b7e4dbf4016dca4b1ba3b5dc34256cf4/ghc"
 2d88a531/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="2d88a531b7e4dbf4016dca4b1ba3b5dc34256cf4"
 Improve warnings for rules that might not fire

 Two main things here

 * Previously we only warned about the "head" function of the rule,
   but actually the warning applies to any free variable on the LHS.

 * We now warn not only when one of these free vars can inline, but
   also if it has an active RULE (c.f. Trac #10528)

 See Note [Rules and inlining/other rules] in Desugar

 This actually shows up quite a few warnings in the libraries, notably
 in Control.Arrow, where it correctly points out that rules like
     "compose/arr"   forall f g .
                     (arr f) . (arr g) = arr (f . g)
 might never fire, because the rule for 'arr' (dictionary selection)
 might fire first.  I'm not really sure what to do here; there is some
 discussion in Trac #10595.

 A minor change is adding BasicTypes.pprRuleName to pretty-print RuleName.
 }}}

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


More information about the ghc-tickets mailing list