A library for constructing multi-way trees. Each Tree carries two pieces of information, it's datum and children.
A list of Trees. Convenient for describing children.
Access the datum of the current tree
Access the children of the current tree
Reduce a Tree from the left.
Reduce a Tree from the right.
Flattens a Tree into a List where the root is the first element of that list.
Filter the MultiwayTree. Keep only elements whose datum satisfy the predicate.
Filter the MultiwayTree. If the predicate is True for a Child the entire path to the root will be part of the result Tree.
Return the length of the Tree. Calculated recusively as datum (1) + length of children (n) Since a MultiwayTree is never empty this function will never return Int < 1.
Inserts a Tree as the first child of a Tree
Inserts a Tree as the last child of a Tree
Map over the MultiwayTree
Map a Function over a List and a MultiwayTree.
Same as map but the function is also applied to the index of each element (starting at zero).
A type to keep track of datum and children.