• Simon Peyton Jones's avatar
    Improve warnings for rules that might not fire · 2d88a531
    Simon Peyton Jones authored
    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.
    2d88a531
TcIface.hs 61.8 KB