Branch (Leaf 2, Leaf 3), ([], [Leaf 4])
-We still need to add the rest of the context. But just computed that
+We still need to add the rest of the context. But we just computed that
context a minute ago. It was ([Leaf 1], []). If we add it here, we get:
Branch (Leaf 2, Leaf 3), ([], [Leaf 4], ([Leaf 1], [])
type context = Root | Context of (tree list) * (tree list) * context
type zipper = tree * context
-We can gloss `Context of (tree list) * (tree list) * context` as
-`Context of (left siblings) * (right siblings) * (context of parent)`.
+We can gloss the triple `(tree list) * (tree list) * context` as
+`(left siblings) * (right siblings) * (context of parent)`.
Here, then, is the full tree zipper we've been looking for:
- (Branch [Leaf 2; Leaf 3],
- Context ([], [Leaf 4], Context ([Leaf 1], [], Root)))
+ (Branch [Leaf 2; Leaf 3],
+ Context ([], [Leaf 4], Context ([Leaf 1], [], Root)))
Just as with the simple list zipper, note that elements that are near
the focussed element in the tree are near the focussed element in the