dual-tree

Rose trees with cached and accumulating monoidal annotations

Version on this page:0.2.3.1@rev:1
LTS Haskell 22.36:0.2.3.1@rev:3
Stackage Nightly 2024-10-03:0.2.3.1@rev:3
Latest on Hackage:0.2.3.1@rev:3

See all snapshots dual-tree appears in

BSD-3-Clause licensed by Brent Yorgey
Maintained by [email protected]
This version can be pinned in stack with:dual-tree-0.2.3.1@sha256:0795e17ce024fa9745ef62d4f5af9492f5e2c6a88296dbb179f9c115e07f2b5f,2848

Module documentation for 0.2.3.1

Rose (n-ary) trees with both upwards- (i.e. cached) and downwards-traveling (i.e. accumulating) monoidal annotations. This is used as the core data structure underlying the diagrams framework (https://diagrams.github.io), but potentially has other applications as well.

Abstractly, a DUALTree is a rose (n-ary) tree with data (of type l) at leaves, data (of type a) at internal nodes, and two types of monoidal annotations, one (of type u) travelling "up" the tree and one (of type d) traveling "down".

See Data.Tree.DUAL for full documentation. Data.Tree.DUAL provides a public API which should suffice for most purposes. Data.Tree.DUAL.Internal exports more of the internal implementation---use it at your own risk.