module Tree_adv:EXPERIMENTAL: A new way of placing trees.`sig`

..`end`

This module provides even more high-level means for placing trees.

`type ``'a`

t =

`|` |
`Node of ` |
`(*` | The type of polymorphic trees | `*)` |

module Place:

`val gen_draw_arrows : ``'a ->`

style:(Point.t -> Point.t -> 'a) ->

corner:(Box.position -> 'b -> Point.t) ->

'b t -> 'a t

draws arrows from a node to its children with a given style

`val draw : ``('a -> Box.t) -> 'a t -> Command.t`

Draws a tree that has already been placed when one knows how to draw its
elements.

`val map : ``('a -> 'b) -> 'a t -> 'b t`

apply a function everywhere in the tree

`val map2 : ``('a -> 'b -> 'c) ->`

'a t -> 'b t -> 'c t

`map2 f`

takes two trees of identical structure and applies the function
`f`

to every pair of nodes. Raise `Invalid_argument`

if the trees do not
have the same structure.`val combine : ``'a t -> 'b t -> ('a * 'b) t`

Transform a pair of trees into a tree of pairs. Raise

`Invalid_argument`

if the trees do not have the same structure.`val split : ``('a * 'b) t -> 'a t * 'b t`

Transform a tree of pairs into a pair of trees.

`val root_map : ``('a option -> 'a -> 'b) -> 'a t -> 'b t`

`root_map f t`

calls `f (Some father) node`

for each node of `t`

and its
father. It calls `f None root`

, where `root`

is the root of the once, once
at the beginning. A tree having the same structure is built with the
results.`val map_children : ``('a -> 'a list -> 'b) -> 'a t -> 'b t`

`map_children f t`

calls `f node children`

for each node of `t`

and its
children. A tree having the same structure is built with the results`val fold : ``('a -> 'b -> 'a) -> 'a -> 'b t -> 'a`

Traverse the tree in a bottom-up, left-to-right order

`val filter : ``('a -> bool) -> 'a t -> 'a t`

filter f t
If for a node n of t f n is false then it doesn't appear in the result
as well as its descendants. If f is false for the root node,
invalid_argument is raised

`val filter_option : ``('a -> 'b option) -> 'a t -> 'b t`

Suppress a subtree depending on a condition on the node

`val wrap_corner_box : ``('a -> Box.t) ->`

(corner:(Box.position -> 'a -> Point.t) -> 'b) -> 'b

`wrap_corner_box give_box f`

returns `f`

where its argument corner has
been setmodule Overlays:`sig`

..`end`

Tools for overlay aware trees

module Overlays_Boxlike: