Closed
Description
Right now we have a Fold
trait that is used to transform types and other bits of IR. But sometimes we don't need to recreate the IR, we instead want to compute a value (e.g., count all the types etc). You can model this as a folder with mutable state, but it'd be more efficient to have a "visitor" trait.
Some examples where this would be useful:
- the truncator is right now only used to detect when terms get too big
- the
UCollector
- the
needs_shift
method - some upcoming work as well