Some transformations and traversals, such as freevars for finding all free names in an expression, do the recursive traversal by hand. Short of beating something out of lens, I think we could use this approach here: https://www.twanvl.nl/blog/haskell/traversing-syntax-trees (replace the Depth parameter with the "context" of the traversal or fold, e.g. the set of names, the annotation, the current primitive fragment).
Some transformations and traversals, such as
freevars
for finding all free names in an expression, do the recursive traversal by hand. Short of beating something out oflens
, I think we could use this approach here: https://www.twanvl.nl/blog/haskell/traversing-syntax-trees (replace theDepth
parameter with the "context" of the traversal or fold, e.g. the set of names, the annotation, the current primitive fragment).