Module Imperative.MakeNumberedNode

Same as MakeNode, but also remembers all built node in a hash-table so we can check if elements already have an associated node

Parameters

Signature

include sig ... end
val polyeq : 'a t -> 'b t -> ('a, 'b) PatriciaTree.cmp
module Relation : sig ... end
type !'a parent = 'a MakeNode(Elt)(Relation).parent =
  1. | Node : 'b t * ('a0, 'b) Relation.t -> 'a0 parent
  2. | Root
val get_parent : 'a t -> 'a parent
val set_parent : 'a t -> 'a parent -> unit
val payload : 'a t -> 'a Elt.t

Inspect the payload of a node

val make_node : 'a Elt.t -> 'a t

Create a new node, in its own class. At most one node should be created per unique element!

val get_node : 'a Elt.t -> 'a t option

Checks if a node has already been constructed for the given element

val get_or_make_node : 'a Elt.t -> 'a t

Returns the node associated with the given element if it exists, else builds it