Module Imperative.MakeNode

Create a simple node by wrapping an elt with a pointer

Parameters

Signature

include Parameters.UF_NODE with module Relation = Relation
include Parameters.SIMPLE_GENERIC_ELT
type 'a t

The type of elements (nodes) in the union-find structure

val polyeq : 'a t -> 'b t -> ('a, 'b) PatriciaTree.cmp

polymorphic equality on elements

module Relation = Relation
type 'a parent =
  1. | Node : 'b t * ('a, 'b) Relation.t -> 'a parent
  2. | Root
    (*

    The type of parents. A term either points to:

    • a representative via a relation
    • a root if it is a representative
    *)
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!