package unionFind

  1. Overview
  2. Docs

Module UnionFind.MakeSource

Parameters

module S : sig ... end

Signature

Sourcetype '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.

Sourcetype 'a store = 'a content S.store
Sourceval new_store : unit -> 'a store
Sourcetype 'a rref = 'a content S.rref
Sourceval make : 'a store -> 'a -> 'a store * 'a rref
Sourceval get : 'a store -> 'a rref -> 'a store * 'a
Sourceval set : 'a store -> 'a rref -> 'a -> 'a store
Sourceval 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.

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

Innovation. Community. Security.