Skip to content

Refactor the simplifier a bit to fix #22761

Simon Peyton Jones requested to merge wip/T22761 into master

The core change in this commit, which fixes #22761 (closed), is that

  • In a Core rule, ru_rhs is always occ-analysed.

This means adding a couple of calls to occurAnalyseExpr when building a Rule, in

  • GHC.Core.Rules.mkRule
  • GHC.Core.Opt.Simplify.Iteration.simplRules

But diagosing the bug made me stare carefully at the code of the Simplifier, and I ended up doing some only-loosely-related refactoring.

  • I think that RULES could be lost because not every code path did addBndrRules

  • The code around lambdas was very convoluted

It's mainly moving deck chairs around, but I like it more now.

Edited by Simon Peyton Jones

Merge request reports