Lenses for Tree Traversals Redux

from blog Terms and Truth-Conditions, | ↗ original
Previously I wrote about how you can use explicit Traversals from lens to simplify some aspects of tree manipulation. I recently had another win using this, so here’s another case study! It also provides a better example for when you want to fold over things than the previous post had.