Module Mlpost.Tree_adv
EXPERIMENTAL: A new way of placing trees.
type 'a t=|Node of 'a * 'a t listThe type of polymorphic trees
Functions for placement
module Place : functor (X : Signature.Boxlike) -> sig ... endUseful functions
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c tmap2 ftakes two trees of identical structure and applies the functionfto every pair of nodes. RaiseInvalid_argumentif the trees do not have the same structure.
val combine : 'a t -> 'b t -> ('a * 'b) tTransform a pair of trees into a tree of pairs. Raise
Invalid_argumentif the trees do not have the same structure.
val root_map : ('a option -> 'a -> 'b) -> 'a t -> 'b troot_map f tcallsf (Some father) nodefor each node oftand its father. It callsf None root, whererootis 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 tmap_children f tcallsf node childrenfor each node oftand its children. A tree having the same structure is built with the results
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aTraverse the tree in a bottom-up, left-to-right order
val fold_child : ('a -> 'b -> 'b -> 'a) -> 'a -> 'b t -> 'aTraverse the pairs of parent-child in the tree in a bottom-up, left-to-right order
val filter : ('a -> bool) -> 'a t -> 'a tfilter 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 tSuppress a subtree depending on a condition on the node
val wrap_corner_box : ('a -> Box.t) -> (corner:(Box.position -> 'a -> Point.t) -> 'c) -> 'cwrap_corner_box give_box freturnsfwhere its argument corner has been set
module Overlays : sig ... endTools for overlay aware trees
module Overlays_Boxlike : functor (X : Signature.Boxlike) -> Signature.Boxlike with type t = X.t Overlays.spec