Module Map.Using_comparator

Using_comparator is a similar interface as the toplevel of Map, except the functions take a ~comparator:('k, 'cmp) Comparator.t, whereas the functions at the toplevel of Map take a ('k, 'cmp) comparator.

type nonrec ('k, +'v, 'cmp) t = ('k'v'cmp) t
val sexp_of_t : ('k -> Base.Sexp.t) -> ('v -> Base.Sexp.t) -> ('cmp -> Base.Sexp.t) -> ('k'v'cmp) t -> Base.Sexp.t
val t_of_sexp_direct : comparator:('k'cmp) Base.Comparator.t -> (Base.Sexp.t -> 'k) -> (Base.Sexp.t -> 'v) -> Base.Sexp.t -> ('k'v'cmp) t
module Tree : sig ... end
include Base__.Map_intf.Accessors3 with type ('a, 'b, 'c) t := ('a'b'c) t with type ('a, 'b, 'c) tree := ('a'b'c) Tree.t
type ('a, 'b, 'cmp) t
type ('a, 'b, 'cmp) tree
val invariants : (___) t -> bool
val is_empty : (___) t -> bool
val length : (___) t -> int
val add : ('a'b'cmp) t -> key:'a -> data:'b -> ('a'b'cmp) t Base__.Map_intf.Or_duplicate.t
val add_exn : ('a'b'cmp) t -> key:'a -> data:'b -> ('a'b'cmp) t
val set : ('a'b'cmp) t -> key:'a -> data:'b -> ('a'b'cmp) t
val add_multi : ('a'b list, 'cmp) t -> key:'a -> data:'b -> ('a'b list, 'cmp) t
val remove_multi : ('a'b list, 'cmp) t -> 'a -> ('a'b list, 'cmp) t
val find_multi : ('a'b list, 'cmp) t -> 'a -> 'b list
val change : ('a'b'cmp) t -> 'a -> f:('b option -> 'b option) -> ('a'b'cmp) t
val update : ('a'b'cmp) t -> 'a -> f:('b option -> 'b) -> ('a'b'cmp) t
val find : ('a'b'cmp) t -> 'a -> 'b option
val find_exn : ('a'b'cmp) t -> 'a -> 'b
val remove : ('a'b'cmp) t -> 'a -> ('a'b'cmp) t
val mem : ('a'b'cmp) t -> 'a -> bool
val iter_keys : ('a_'cmp) t -> f:('a -> unit) -> unit
val iter : (_'b'cmp) t -> f:('b -> unit) -> unit
val iteri : ('a'b'cmp) t -> f:(key:'a -> data:'b -> unit) -> unit
val iter2 : ('a'b'cmp) t -> ('a'c'cmp) t -> f:(key:'a -> data:[ `Left of 'b | `Right of 'c | `Both of 'b * 'c ] -> unit) -> unit
val map : ('a'b'cmp) t -> f:('b -> 'c) -> ('a'c'cmp) t
val mapi : ('a'b'cmp) t -> f:(key:'a -> data:'b -> 'c) -> ('a'c'cmp) t
val fold : ('a'b_) t -> init:'c -> f:(key:'a -> data:'b -> 'c -> 'c) -> 'c
val fold_right : ('a'b_) t -> init:'c -> f:(key:'a -> data:'b -> 'c -> 'c) -> 'c
val fold2 : ('a'b'cmp) t -> ('a'c'cmp) t -> init:'d -> f:(key:'a -> data:[ `Left of 'b | `Right of 'c | `Both of 'b * 'c ] -> 'd -> 'd) -> 'd
val filter_keys : ('a'b'cmp) t -> f:('a -> bool) -> ('a'b'cmp) t
val filter : ('a'b'cmp) t -> f:('b -> bool) -> ('a'b'cmp) t
val filteri : ('a'b'cmp) t -> f:(key:'a -> data:'b -> bool) -> ('a'b'cmp) t
val filter_map : ('a'b'cmp) t -> f:('b -> 'c option) -> ('a'c'cmp) t
val filter_mapi : ('a'b'cmp) t -> f:(key:'a -> data:'b -> 'c option) -> ('a'c'cmp) t
val partition_mapi : ('a'b'cmp) t -> f:(key:'a -> data:'b -> [ `Fst of 'c | `Snd of 'd ]) -> ('a'c'cmp) t * ('a'd'cmp) t
val partition_map : ('a'b'cmp) t -> f:('b -> [ `Fst of 'c | `Snd of 'd ]) -> ('a'c'cmp) t * ('a'd'cmp) t
val partitioni_tf : ('a'b'cmp) t -> f:(key:'a -> data:'b -> bool) -> ('a'b'cmp) t * ('a'b'cmp) t
val partition_tf : ('a'b'cmp) t -> f:('b -> bool) -> ('a'b'cmp) t * ('a'b'cmp) t
val compare_direct : ('b -> 'b -> int) -> ('a'b'cmp) t -> ('a'b'cmp) t -> int
val equal : ('b -> 'b -> bool) -> ('a'b'cmp) t -> ('a'b'cmp) t -> bool
val keys : ('a__) t -> 'a list
val data : (_'b_) t -> 'b list
val to_alist : ?⁠key_order:[ `Increasing | `Decreasing ] -> ('a'b_) t -> ('a * 'b) list
val validate : name:('a -> string) -> 'b Base.Validate.check -> ('a'b_) t Base.Validate.check
val merge : ('a'b'cmp) t -> ('a'c'cmp) t -> f:(key:'a -> [ `Left of 'b | `Right of 'c | `Both of 'b * 'c ] -> 'd option) -> ('a'd'cmp) t
val symmetric_diff : ('a'b'cmp) t -> ('a'b'cmp) t -> data_equal:('b -> 'b -> bool) -> ('a'b) Base__.Map_intf.Symmetric_diff_element.t Base.Sequence.t
val min_elt : ('a'b'cmp) t -> ('a * 'b) option
val min_elt_exn : ('a'b'cmp) t -> 'a * 'b
val max_elt : ('a'b'cmp) t -> ('a * 'b) option
val max_elt_exn : ('a'b'cmp) t -> 'a * 'b
val for_all : (_'b_) t -> f:('b -> bool) -> bool
val for_alli : ('a'b_) t -> f:(key:'a -> data:'b -> bool) -> bool
val exists : (_'b_) t -> f:('b -> bool) -> bool
val existsi : ('a'b_) t -> f:(key:'a -> data:'b -> bool) -> bool
val count : (_'b_) t -> f:('b -> bool) -> int
val counti : ('a'b_) t -> f:(key:'a -> data:'b -> bool) -> int
val split : ('k'v'cmp) t -> 'k -> ('k'v'cmp) t * ('k * 'v) option * ('k'v'cmp) t
val append : lower_part:('k'v'cmp) t -> upper_part:('k'v'cmp) t -> [ `Ok of ('k'v'cmp) t | `Overlapping_key_ranges ]
val subrange : ('k'v'cmp) t -> lower_bound:'k Base.Maybe_bound.t -> upper_bound:'k Base.Maybe_bound.t -> ('k'v'cmp) t
val fold_range_inclusive : ('a'b_) t -> min:'a -> max:'a -> init:'c -> f:(key:'a -> data:'b -> 'c -> 'c) -> 'c
val range_to_alist : ('a'b_) t -> min:'a -> max:'a -> ('a * 'b) list
val closest_key : ('a'b_) t -> [ `Greater_or_equal_to | `Greater_than | `Less_or_equal_to | `Less_than ] -> 'a -> ('a * 'b) option
val nth : ('a'b_) t -> int -> ('a * 'b) option
val nth_exn : ('a'b_) t -> int -> 'a * 'b
val rank : ('a__) t -> 'a -> int option
val to_tree : ('a'b'cmp) t -> ('a'b'cmp) tree
val to_sequence : ?⁠order:[ `Increasing_key | `Decreasing_key ] -> ?⁠keys_greater_or_equal_to:'a -> ?⁠keys_less_or_equal_to:'a -> ('a'b_) t -> ('a * 'b) Base.Sequence.t
include Base__.Map_intf.Creators3_with_comparator with type ('a, 'b, 'c) t := ('a'b'c) t with type ('a, 'b, 'c) tree := ('a'b'c) Tree.t
type ('a, 'b, 'cmp) t
type ('a, 'b, 'cmp) tree
val empty : comparator:('a'cmp) Base.Comparator.t -> ('a_'cmp) t
val singleton : comparator:('a'cmp) Base.Comparator.t -> 'a -> 'b -> ('a'b'cmp) t
val of_alist : comparator:('a'cmp) Base.Comparator.t -> ('a * 'b) list -> [ `Ok of ('a'b'cmp) t | `Duplicate_key of 'a ]
val of_alist_or_error : comparator:('a'cmp) Base.Comparator.t -> ('a * 'b) list -> ('a'b'cmp) t Base.Or_error.t
val of_alist_exn : comparator:('a'cmp) Base.Comparator.t -> ('a * 'b) list -> ('a'b'cmp) t
val of_alist_multi : comparator:('a'cmp) Base.Comparator.t -> ('a * 'b) list -> ('a'b list, 'cmp) t
val of_alist_fold : comparator:('a'cmp) Base.Comparator.t -> ('a * 'b) list -> init:'c -> f:('c -> 'b -> 'c) -> ('a'c'cmp) t
val of_alist_reduce : comparator:('a'cmp) Base.Comparator.t -> ('a * 'b) list -> f:('b -> 'b -> 'b) -> ('a'b'cmp) t
val of_sorted_array : comparator:('a'cmp) Base.Comparator.t -> ('a * 'b) array -> ('a'b'cmp) t Base.Or_error.t
val of_sorted_array_unchecked : comparator:('a'cmp) Base.Comparator.t -> ('a * 'b) array -> ('a'b'cmp) t
val of_increasing_iterator_unchecked : comparator:('a'cmp) Base.Comparator.t -> len:int -> f:(int -> 'a * 'b) -> ('a'b'cmp) t
val of_increasing_sequence : comparator:('a'cmp) Base.Comparator.t -> ('a * 'b) Base.Sequence.t -> ('a'b'cmp) t Base.Or_error.t
val of_iteri : comparator:('a'cmp) Base.Comparator.t -> iteri:(f:(key:'a -> data:'b -> unit) -> unit) -> [ `Ok of ('a'b'cmp) t | `Duplicate_key of 'a ]
val of_tree : comparator:('a'cmp) Base.Comparator.t -> ('a'b'cmp) tree -> ('a'b'cmp) t
val comparator : ('a_'cmp) t -> ('a'cmp) Base.Comparator.t
val hash_fold_direct : 'k Base.Hash.folder -> 'v Base.Hash.folder -> ('k'v'cmp) t Base.Hash.folder
module Empty_without_value_restriction : functor (K : Base.Comparator.S1) -> sig ... end

To get around the value restriction, apply the functor and include it. You can see an example of this in the Poly submodule below.