children_fun(T) = fun((T) -> [T])
info(T) = #{lefts => [T], rights => [T], parent_node => undefined | T, parent_info => undefined | info(T), is_modified => boolean()}
is_branch_fun(T) = fun((T) -> boolean())
make_node_fun(T) = fun((T, [T]) -> T)
operation() = next | prev | up | down | left | right | root | node | rightmost | leftmost
abstract datatype: zipper(T)
append_child/2 | Adds a node as the rightmost child of the current one. |
children/1 | Returns the list of children zippers. |
down/1 | Returns the zipper in the first child, if any. |
edit/3 | Edits the current node by applying the given function. |
filter/2 | Returns a list of all the nodes in the zipper that match a predicate. |
fmap/3 | Returns the root of the tree, where the value of each node (after the current location of Zipper) is replaced with the result from appling Fun to the node as the first argument and Args as additional arguments. |
fold/3 | Applies Fun recursively on the zipper. |
insert_child/2 | Adds a node as the leftmost child of the current one. |
insert_left/2 | Inserts a node to the left of the current one. |
insert_right/2 | Inserts a node to the right of the current one. |
is_branch/1 | Is this node a branch?. |
is_end/1 | Is it the end of the zipper traversal. |
left/1 | Returns the zipper on the left, if any. |
leftmost/1 | Returns the leftmost zipper in the current zipper. |
map/2 | Applies a function to all nodes of the zipper. |
new/4 | Builds a new zipper with nodes of type T. |
next/1 | Returns the next zipper. |
node/1 | Returns the value of the current node in the zipper. |
prev/1 | Returns the previous zipper. |
remove/1 | Removes current node from zipper. |
replace/2 | Replaces the current node. |
right/1 | Returns the zipper on the right, if any. |
rightmost/1 | Returns the rightmost zipper in the current zipper. |
root/1 | Returns the node on the root of the zipper. |
size/1 | Returns the size of the zipper. |
traverse/2 | Traverses the zipper following the given list of operations. |
up/1 | Returns the zipper in the parent node, if possible. |
Adds a node as the rightmost child of the current one.
Returns the list of children zippers.
Returns the zipper in the first child, if any.
Edits the current node by applying the given function. The parameters of said function will be [Node | Args].
filter(Pred::fun((T) -> boolean()), Zipper::zipper(T)) -> [T]
Returns a list of all the nodes in the zipper that match a predicate.
fmap(Fun::fun((...) -> T), Args::[term()], Zipper::zipper(T)) -> T
Returns the root of the tree, where the value of each node (after the current location of Zipper) is replaced with the result from appling Fun to the node as the first argument and Args as additional arguments.
fold(Fun::fun((T, A) -> A), A, Zipper::zipper(T)) -> A
Applies Fun recursively on the zipper. The arguments of Fun will be (Node, Acc) where Acc is the result of the previous call or the initial value provided.
Adds a node as the leftmost child of the current one.
Inserts a node to the left of the current one.
Inserts a node to the right of the current one.
is_branch(X1::zipper(term())) -> boolean()
Is this node a branch?
is_end(Zipper::zipper(term())) -> boolean()
Is it the end of the zipper traversal.
Returns the zipper on the left, if any.
Returns the leftmost zipper in the current zipper.
map(Fun::fun((T) -> U), Zipper::zipper(T)) -> [U]
Applies a function to all nodes of the zipper. Returns a list with the results.
new(IsBranch::is_branch_fun(T), Children::children_fun(T), MakeNode::make_node_fun(T), T) -> zipper(T)
Builds a new zipper with nodes of type T.
Returns the next zipper.
node(X1::zipper(T)) -> T
Returns the value of the current node in the zipper.
Returns the previous zipper.
Removes current node from zipper. Moves down, if possible. If not, it moves to the rightmost node.
Replaces the current node.
Returns the zipper on the right, if any.
Returns the rightmost zipper in the current zipper.
root(Zipper::zipper(T)) -> T
Returns the node on the root of the zipper.
size(Zipper::zipper(term())) -> non_neg_integer()
Returns the size of the zipper.
traverse(Rest::[operation()], Zipper::zipper(T)) -> zipper(T) | T | undefined
Traverses the zipper following the given list of operations. If, at some point, an operation is invalid, it will crash.
Returns the zipper in the parent node, if possible.
Generated by EDoc, May 11 2016, 14:35:50.