Module Int

A native integer module with usual utility functions.

type t = int
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
module Set : Stdlib.Set.S with type elt = t
module Map : CMap.ExtS with type key = t and module Set := Set
module List : sig ... end
module PArray : sig ... end
module PMap : sig ... end

This is a (partial) implementation of a Map interface on integers, except that it internally uses persistent arrays. This ensures O(1) accesses in non-backtracking cases. It is thus better suited for zero-starting, contiguous keys, or otherwise a lot of space will be empty. To keep track of the present keys, a binary tree is also used, so that adding a key is still logarithmic. It is therefore essential that most of the operations are accesses and not add/removes.