Closed adamslc closed 3 years ago
Note that adding PassThrough
will could result in one more isequal
in many cases. For example while running Fixpoint, returning nothing
is better. So I think we should have a switch to turn it off internally at least. Or document it properly.
Good point. It looks like Chain
already has an implicit PassThrough
behavior, so this won't be an issue in the most common case (applying a set of rules at every level in an expression). Maybe this should be a doc fix instead.
Closing in favor of #279.
Following a discussion on Slack, this makes
Prewalk
/Postwalk
behave more intuitively by adding somePassThrough
s. I'm submitting this as a PR and not an issue because I have some code, but I'm not sure that this is the right approach. Consider:So, as you can see, it handles expressions differently based on
istree
. I'm not sure if this is an issue. It would be easy to make the last case consistent with the first two (i.e. returnn
). It would be somewhat more computationally expensive to make it always returnnothing
if the expression has not changed.