package fix

  1. Overview
  2. Docs

Module Fix.GlueSource

Glue contains glue code that helps build various implementations of association maps.

Some common types, packaged as modules of signature TYPE.

Sourcemodule CHAR : sig ... end
Sourcemodule INT : sig ... end
Sourcemodule STRING : sig ... end

An arbitrary type can be equipped with an ordering function, just by using OCaml's built-in generic comparison function.

Sourcemodule TrivialOrderedType (T : sig ... end) : Map.OrderedType with type t = T.t

An arbitrary type can be equipped with equality and hash functions, just by using OCaml's built-in generic equality and hash functions.

Sourcemodule TrivialHashedType (T : sig ... end) : Hashtbl.HashedType with type t = T.t

If there is an injection of t into u, then an ordering on u gives rise to an ordering on t.

Sourcemodule InjectOrderedType (U : Map.OrderedType) (I : sig ... end) : Map.OrderedType with type t = I.t

If there is an injection of t into u, then a hashed-type structure on u can be transported to t.

Sourcemodule InjectHashedType (U : Hashtbl.HashedType) (I : sig ... end) : Hashtbl.HashedType with type t = I.t

If there is an injection of t into u, then an implementation of minimal imperative maps for the type u can be transported to the type t.

Sourcemodule InjectMinimalImperativeMaps (M : sig ... end) (I : sig ... end) : sig ... end

If there is an injection of t into u, and if the inverse mapping can be effectively computed, then an implementation of imperative maps for the type u can be transported to the type t.

Sourcemodule InjectImperativeMaps (M : sig ... end) (I : sig ... end) (J : sig ... end) : sig ... end

Implementations of various map signatures.

An implementation of persistent maps can be made to satisfy the interface of imperative maps. An imperative map is represented as a persistent map, wrapped within a reference cell.

Sourcemodule PersistentMapsToImperativeMaps (M : sig ... end) : sig ... end

An implementation of imperative maps as arrays is possible if keys are consecutive integers.

Sourcemodule ArraysAsImperativeMaps (K : sig ... end) : sig ... end

An implementation of imperative maps as a hash table.

An implementation of imperative maps as a weak hash table. Use with caution: this table can forget some of its entries, and can therefore be unsuitable for use in some applications.

MinimalSemiLattice converts a semi-lattice to a minimal semi-lattice; that is, it implements leq_join in terms of separate leq and join operations.

Sourcemodule MinimalSemiLattice (P : sig ... end) : sig ... end
OCaml

Innovation. Community. Security.