A tiny tiny tree module. Only a few utility methods are provided here - after all, if you want to manupilate the tree, you should probably do so using the interface 🤓.
Flatten a tree into a list of ( path, node ) tuples. The path is a list of integers showing how you can get to the node (the root would be [], its first child [ 1 ]).
Recursive tree structure, holding any data type
node, and any number of child nodes. Creating a tree of strings, for instance, would look like this: