projects
/
lambda.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
37b002e
)
edits
author
Chris
<chris.barker@nyu.edu>
Sun, 26 Apr 2015 22:31:03 +0000
(18:31 -0400)
committer
Chris
<chris.barker@nyu.edu>
Sun, 26 Apr 2015 22:31:03 +0000
(18:31 -0400)
topics/week12_list_and_tree_zippers.mdwn
patch
|
blob
|
history
diff --git
a/topics/week12_list_and_tree_zippers.mdwn
b/topics/week12_list_and_tree_zippers.mdwn
index
2f5d5dc
..
3f7ca7a
100644
(file)
--- a/
topics/week12_list_and_tree_zippers.mdwn
+++ b/
topics/week12_list_and_tree_zippers.mdwn
@@
-213,7
+213,7
@@
siblings of the focussed tree:
Branch (Leaf 2, Leaf 3), ([], [Leaf 4])
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], [])
context a minute ago. It was ([Leaf 1], []). If we add it here, we get:
Branch (Leaf 2, Leaf 3), ([], [Leaf 4], ([Leaf 1], [])
@@
-223,13
+223,13
@@
Here's the type suggested by this idea:
type context = Root | Context of (tree list) * (tree list) * context
type zipper = tree * context
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:
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
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