2.3.11.1, encoding their path from root.true. All operations short-circuit whenever possible.Encode/decode losslessly to/from different tree encodings.
| Name | Codec Source |
|---|---|
| Nested arrays | source |
| Edge lists | source |
| Indented string | source |
| Path List | source |
| Prüfer codes | source |
Law tests test encode/decode round-trip.
| Name | Instance | Typeclass | Laws |
|---|---|---|---|
| Applicative | source | source | source |
| Covariant | source | source | source |
| Equivalence | source | source | source |
| Foldable | source | source | source |
| Monad | source | source | source |
| Order | source | source | source |
| Traversable | source | source | source |
Laws are listed in the book of laws and law tests can be found here.
Functions like mapEffect
and
traverseEffect that run
a effectful functions on the tree have pre-order variants at the pre key of
the function. For example, the
mapEffect.pre
function will traverse the tree in depth-first pre-order.
| Basic | Create a tree, add/remove nodes, and other basic use-cases. |
| Codecs | Encode/decode the same tree through all codecs. |
| Draw | Draw trees in various themes. |
| Fibonacci | A custom fold: unfold the Fibonacci sequence into a linear tree. |
| Folds | Fusing folds into tuples and structs. |
| Genealogy | Level labels, bottom grounded subtrees, and encoding to indented strings. |
| Generate | Enumerate and generate trees. |
| Layout | Alternate tree layouts using the Draw module. |
Draw trees for terminal output. Customize layout and symbols, and compose layouts from parts. All functions are ANSI text aware and should work with styled text and wide characters.
Click on the example screenshots to go to the source code.