For performance reasons, we do not use an OCaml existential type for Node.Packed.t
:
type t = T : _ Node.t -> t
The extra indirection when following pointers to packed nodes would be too slow.
Consequently, there is a possible bug in which we mix the 'a
from two packed nodes
with different types. We reduce the chance of this bug by minimizing the scopes in
which we deal with packed nodes.
include sig ... end
val sexp_of_t : t ‑> Base.Sexp.t
As_list
allows one to view a node as a list w.r.t. a particular next
pointer
contained within it. The recompute heap uses this with next_in_recompute_heap
,
and the adjust-heights heap uses this with next_in_adjust_heights_heap
.
iter_descendants ts ~f
calls f
on every node in ts
and all of their
descendants exactly once per node.
val save_dot : string ‑> t list ‑> unit