Module Int.PMap
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.
val empty : 'a tval is_empty : 'a t -> boolval mem : key -> 'a t -> boolval add : key -> 'a -> 'a t -> 'a tval singleton : key -> 'a -> 'a tval remove : key -> 'a t -> 'a tval iter : (key -> 'a -> unit) -> 'a t -> unitval fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'bval for_all : (key -> 'a -> bool) -> 'a t -> boolval exists : (key -> 'a -> bool) -> 'a t -> boolval find : key -> 'a t -> 'aval domain : 'a t -> Set.tval cast : 'a t -> 'a Map.t