Radix.traverse

You're seeing just the function traverse, go back to Radix module for more information.
Link to this function

traverse(tree, fun, acc, order \\ :inorder)

View Source

Specs

traverse(tree(), (acc(), tree() | leaf() -> acc()), acc(), atom()) :: acc()

Invokes fun on all (internal and leaf) nodes of the radix tree using either :inorder, :preorder or :postorder traversal.

fun should have the signatures:

Note that leaf/0 might be nil.

Example

iex> t = new([{<<1>>, 1}, {<<2>>, 2}, {<<3>>, 3}, {<<128>>, 128}])
iex>
iex> f = fn
...>   (acc, {_bit, _left, _right}) -> acc
...>   (acc, nil) -> acc
...>   (acc, leaf) -> acc ++ Enum.map(leaf, fn {_k, v} -> v end)
...> end
iex>
iex> traverse(t, f, [])
[1, 2, 3, 128]