kvm.common
tree-edit
(tree-edit zipper matcher editor)
Take a zipper, a function that matches a pattern in the tree, and a function that edits the current location in the tree. Examine the tree nodes in depth-first order, determine whether the matcher matches, and if so apply the editor.