Skip to content

Make RULE matching insensitive to eta-expansion

Simon Peyton Jones requested to merge wip/T19790a into master

This is a new MR for #19790 (closed), focusing just on RULES

This patch fixes #19790 (closed) by making the rule matcher do on-the-fly eta reduction. See Note [Eta reduction the target] in GHC.Core.Rules

Other things in here

  • I found I also had to careful about casts when matching; see Note [Casts in the target] and Note [Casts in the template]

  • I made eta-reduction conditional on sm_eta_expand, in GHC.Core.Opt.Simplify.Utils.mkLam; reasons explained in Note [Casts and lambdas] in that module.

  • Lots more comments and Notes in the rule matcher

Merge request reports