package jhupllib

  1. Overview
  2. Docs

Module Jhupllib_witness_protectionSource

This module provides a means by which a registry of "witnesses" can be created. Here, a witness is a representative of another (typically more complex) value. A witness registry is a mutable structure which monotonically accumulates values, mapping distinct values to distinct witnesses. The primary use of such a registry is to accelerate comparison operations. For instance, using witnesses as keys in a tree-based dictionary may be faster than using the original values if the comparison between two values is an expensive operation.

Sourcemodule type Spec = sig ... end

This module type describes the information required to create a witness registry module.

Sourcemodule type Registry = sig ... end

This is the type of a witness registry module.

Sourcemodule Make (S : Spec) : Registry with type elt = S.t

A functor which creates witness registries.

Sourcemodule type Escorted_registry = sig ... end

The type of a registry with an escort. Escorts pair the witnesses with their registries to make operations such as pretty-printing easier. This module only defines escorts and their basic comparison operations. More operations can be added by including utils modules produced by the other functors in this module.

A functor to make registries with escorts.

Sourcemodule type Pp_utils = sig ... end

The type of a pretty-printing utility module for witness registries.

A functor to produce a pretty-printing utility module.

Sourcemodule type To_yojson_utils = sig ... end

The type of a to-yojson utility module for witness registries.

A functor to produce a pretty-printing utility module.