Module Tjr_lib_core.Tjr_map

type ('k, 'v, 't) map_ops = {
k_cmp : 'k -> 'k -> int;
empty : 't;
is_empty : 't -> bool;
mem : 'k -> 't -> bool;
add : 'k -> 'v -> 't -> 't;
remove : 'k -> 't -> 't;
cardinal : 't -> int;
bindings : 't -> ('k * 'v) list;
of_bindings : ('k * 'v) list -> 't;
max_binding_opt : 't -> ('k * 'v) option;
min_binding_opt : 't -> ('k * 'v) option;
split : 'k -> 't -> 't * 'v option * 't;
find : 'k -> 't -> 'v;
find_opt : 'k -> 't -> 'v option;
update : 'k -> ('v option -> 'v option) -> 't -> 't;
disjoint_union : 't -> 't -> 't;
find_first_opt : ('k -> bool) -> 't -> ('k * 'v) option;
find_last_opt : ('k -> bool) -> 't -> ('k * 'v) option;
iter : ('k -> 'v -> unit) -> 't -> unit;
map : ('v -> 'v) -> 't -> 't;
}
val map_merge : map_ops:('a'b'c) map_ops -> old:'c -> new_:'c -> 'c
module type S = sig ... end
module type T = sig ... end
module Make_map_ops : functor (S : S) -> T with type k = S.k and type v = S.v

Functor to make map ops; generates a new impl type 't

type ('k, 'v, 't) map

To avoid functors, we introduce a phantom type for a default implementation of map using OCaml's built in map. NOTE for every 'k,'v,k_cmp... 't should be an abstract type about which nothing is known (eg not unit or anything like that... otherwise different k_cmp orderings might have impls with the same type). The user of this library has to provide the 't

val unsafe_make_map_ops : ('k -> 'k -> int) -> ('k'v('k'v't) map) map_ops

NOTE the following is unsafe, because the type t is unconstrained; it is up to you to make sure that this doesn't cause problems. If in doubt, use the functor version

module With_stdcmp : sig ... end

Make maps ops based on pervasives_compare; also provides ops bound at module level (rather than in a record). Bit of a hack.

module With_base : sig ... end
module With_base_as_record : sig ... end