Module Numbering.ForOrderedType

ForOrderedType is a special case of Make where it suffices for keys to be ordered.


module T : sig ... end


type t = T.t

The type t of values of interest.

val encode : t -> int

encode maps a value of type t to a unique integer code. If applied twice to the same value, encode returns the same code; if applied to a value that has never been encountered, it returns a fresh code.

val current : unit -> int

current() returns the next available code, which is also the number of values that have been encoded so far.

val has_been_encoded : t -> bool

has_been_encoded x determines whether the value x has been encoded already.

module Done () : sig ... end

The functor Done ends the numbering process.