early position, we've wasted our time examining the rest of the trees.
The second solution was to use tree zippers and mutable state to
-simulate coroutines (see [[coroutines and aborts]], and [[assignment
-8]]). In that solution, we pulled the zipper on the first tree until
-we found the next leaf, then stored the zipper structure in the
-mutable variable while we turned our attention to the other tree.
+simulate coroutines (see [[coroutines and aborts]], and
+[[assignment8]]). In that solution, we pulled the zipper on the first
+tree until we found the next leaf, then stored the zipper structure in
+a mutable variable while we turned our attention to the other tree.
This solution is efficient: the zipper doesn't visit any leaves beyond
the first mismatch.
solution.
2. Review how the continuation-flavored tree\_monadizer managed to
- map a tree to a list of its leaves, in [[manipulating trees with
- monads]]. Spend some time trying to understand exactly what it
+ map a tree to a list of its leaves, in [[manipulating trees with monads]].
+ Spend some time trying to understand exactly what it
does: compute the tree-to-list transformation for a tree with two
leaves, performing all beta reduction by hand using the
definitions for bind\_continuation, unit\_continuation and so on.