Module Imperative.GenericRelational

Same as GenericRelationalValued, but without the values

Parameters

Signature

type 'a t = 'a Node.t
type ('a, 'b) relation = ('a, 'b) Node.Relation.t
type 'a node_through_relation =
  1. | NodeThoughRelation : 'b t * ('a, 'b) relation -> 'a node_through_relation

Existential wrapper for returning the representative

val find_representative : 'a t -> 'a node_through_relation

Find the representative of a node, and the associated relation

check_related a b returns the relation between a and b if they are in the same class.

val union : 'a t -> 'b t -> ('a, 'b) relation -> (unit, ('a, 'b) relation) Stdlib.result

union m n r adds the m--(r)-->n relation to the union find returns Ok () on success, Error rel if m and n are already related via another relation rel and r != rel.