
David Feuer
On Friday, February 17, 2017 12:33:12 AM EST Simon Peyton Jones via ghc-devs wrote:
The "L" rule becomes problematic when we try to identify static data the simplifier shouldn't have to try to optimize. If it identifies LCon 0 as static, the "L" rule will never fire.
Why doesn’t it fire?
I’m afraid I still do not understand what change is proposed, so I’m finding it difficult to see how to fix problems with it.
I'm sorry; I wasn't trying to be obtuse; easy to drop context by mistake. The idea, at least roughly, is to have a "static" flag on each term. A term is considered static if it's
1. A Core literal, 2. A nullary constructor, or 3. A constructor whose arguments are all static.
Once a term is flagged static, the simplifier simply shouldn't try to optimize it--doing so is simply a waste of time.
For the record, David is referring to the proposal I briefly describe in ticket #13282. I started on a patch implementing this idea earlier this week, but eventually encountered enough tricky cases that I decided to put it aside for now to focus on the 8.2 release. Moreover, I have a sneaking suspicion Simon might be working along some similar threads. Cheers, - Ben