package unionFind

  1. Overview
  2. Docs

Parameters

module S : sig ... end

Signature

type 'a content

The new store is implemented on top of the store provided by the user. This means that any extra operations supported by the underlying store (such as, say, opening and committing a transaction) are applicable to this new store as well.

Operations for creating a new store, creating a new reference, reading and writing a reference, and comparing two references. Two references are considered equal after they have been merged by union.

type 'a store = 'a content S.store
val new_store : unit -> 'a store
type 'a rref = 'a content S.rref
val make : 'a store -> 'a -> 'a store * 'a rref
val get : 'a store -> 'a rref -> 'a store * 'a
val set : 'a store -> 'a rref -> 'a -> 'a store
val eq : 'a store -> 'a rref -> 'a rref -> 'a store * bool

union f s x y does nothing if the references x and y are equal, and merges them if they are distinct. In the latter case, the new content of the merged reference is computed by applying the user-supplied function f to the original contents of x and y.

val union : ('a -> 'a -> 'a) -> 'a store -> 'a rref -> 'a rref -> 'a store
OCaml

Innovation. Community. Security.