package jhupllib

  1. Overview
  2. Docs
include Registry
type t

The type of a witness registry.

type elt

The type of elements stored in the registry.

type witness

The type of a witness in the registry.

val empty_registry : unit -> t

A function to produce an empty witness registry. Registries use mutable data structures to cache results, so each empty registry must be created separately.

val witness_of : t -> elt -> witness

Obtains a witness for the provided value. If the value already has a witness, it is returned; otherwise, a new witness is created and returned. If the same element is added to two different registries, it will not be given the same witness for each.

val element_of : t -> witness -> elt

Obtains a value for the provided witness. Raises Not_found if no such witness is stored in the provided registry.

val equal_witness : witness -> witness -> bool

Determines if two witnesses are equal. Two witnesses are equal only if they witness the same value.

val compare_witness : witness -> witness -> int

Compares two witnesses. This comparison operation is arbitrary; although the element type must be comparable, there is no guarantee of a connection between the comparison of elements and the comparison of their witnesses.

type escorted_witness
val witness_of_escorted_witness : escorted_witness -> witness
val registry_of_escorted_witness : escorted_witness -> t
val element_of_escorted_witness : escorted_witness -> elt
val escorted_witness_of : t -> elt -> escorted_witness
val share_escort : escorted_witness -> elt -> escorted_witness
val equal_escorted_witness : escorted_witness -> escorted_witness -> bool
val compare_escorted_witness : escorted_witness -> escorted_witness -> int
OCaml

Innovation. Community. Security.