module PMappe:Association tables over ordered types, parametrized polymorphic versionsig..end
Mappe, but each map stores its comparison
function.
If compiled without -noassert option, checks for binary
operations that the two arguments refers to the same
comparison function (by testing physical equality).
BE CAUTIOUS: do not use Pervasives.compare function
directly, as it is an external function, so that writing
t1.cmp <- Pervasives.compare induces the creation of a
closure, and if later t2.cmp <- Pervasives.compare is
executed, t1.cmp != t2.cmp because two different closures
have been created. Instead, first define let compare = fun x
y -> Pervasives.compare x y in ....
type ('a, 'b) t = {
|
compare : |
|
map : |
val is_empty : ('a, 'b) t -> boolval empty : ('a -> 'a -> int) -> ('a, 'b) tval add : 'a -> 'b -> ('a, 'b) t -> ('a, 'b) tval find : 'a -> ('a, 'b) t -> 'bval remove : 'a -> ('a, 'b) t -> ('a, 'b) tval mem : 'a -> ('a, 'b) t -> boolval addmap : ('a, 'b) t -> ('a, 'b) t -> ('a, 'b) tval merge : ('b -> 'b -> 'b) ->
('a, 'b) t -> ('a, 'b) t -> ('a, 'b) tval mergei : ('a -> 'b -> 'b -> 'b) ->
('a, 'b) t -> ('a, 'b) t -> ('a, 'b) tval common : ('b -> 'c -> 'd) ->
('a, 'b) t -> ('a, 'c) t -> ('a, 'd) tval commoni : ('a -> 'b -> 'c -> 'd) ->
('a, 'b) t -> ('a, 'c) t -> ('a, 'd) tval combine : ('a -> 'b option -> 'c option -> 'd option) ->
('a, 'b) t -> ('a, 'c) t -> ('a, 'd) tval interset : ('a, 'b) t -> 'a PSette.t -> ('a, 'b) tval diffset : ('a, 'b) t -> 'a PSette.t -> ('a, 'b) tval iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unitval map : ('b -> 'c) -> ('a, 'b) t -> ('a, 'c) tval mapi : ('a -> 'b -> 'c) -> ('a, 'b) t -> ('a, 'c) tval fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'cval maptoset : ('a, 'b) t -> 'a PSette.tval mapofset : ('a -> 'b) -> 'a PSette.t -> ('a, 'b) tval compare : ('b -> 'c -> int) -> ('a, 'b) t -> ('a, 'c) t -> intval comparei : ('a -> 'b -> 'c -> int) -> ('a, 'b) t -> ('a, 'c) t -> intval equal : ('b -> 'c -> bool) -> ('a, 'b) t -> ('a, 'c) t -> boolval equali : ('a -> 'b -> 'c -> bool) -> ('a, 'b) t -> ('a, 'c) t -> boolval subset : ('b -> 'c -> bool) -> ('a, 'b) t -> ('a, 'c) t -> boolval subseti : ('a -> 'b -> 'c -> bool) -> ('a, 'b) t -> ('a, 'c) t -> boolval filter : ('a -> 'b -> bool) -> ('a, 'b) t -> ('a, 'b) tval partition : ('a -> 'b -> bool) ->
('a, 'b) t -> ('a, 'b) t * ('a, 'b) tval cardinal : ('a, 'b) t -> intval bindings : ('a, 'b) t -> ('a * 'b) listval min_key : ('a, 'b) t -> 'aval max_key : ('a, 'b) t -> 'aval choose : ('a, 'b) t -> 'a * 'bval print : ?first:(unit, Format.formatter, unit) Pervasives.format ->
?sep:(unit, Format.formatter, unit) Pervasives.format ->
?last:(unit, Format.formatter, unit) Pervasives.format ->
?firstbind:(unit, Format.formatter, unit) Pervasives.format ->
?sepbind:(unit, Format.formatter, unit) Pervasives.format ->
?lastbind:(unit, Format.formatter, unit) Pervasives.format ->
(Format.formatter -> 'a -> unit) ->
(Format.formatter -> 'b -> unit) ->
Format.formatter -> ('a, 'b) t -> unit