Simon Willison’s Weblog

Breadth first traversal of a tree. Mind bending usage of yield. Depth-first traversal is left as an exercise for the reader.