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 🤓.
Tree decoder as a function of the node's decoder. Assumes a value and children fields, holding the current node contents and an array of children, respectively.
Tree depth.
Map over the nodes of the tree.
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: