Rose trees with cached and accumulating monoidal annotations

Version on this page:0.2.1
LTS Haskell 16.31:
Stackage Nightly 2020-06-16:
Latest on Hackage:

See all snapshots dual-tree appears in

BSD-3-Clause licensed by Brent Yorgey
This version can be pinned in stack with:dual-tree-0.2.1@sha256:842d3190984106fac7980a7320568b2dcd4145460a9299a05c8d078d4a79de58,2686

Module documentation for 0.2.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 (http://projects.haskell.org/diagrams), 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.