Map.Using_comparatorUsing_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) tval t_of_sexp_direct : comparator:('k, 'cmp) Comparator.t ->
(Sexp.t -> 'k) -> (Sexp.t -> 'v) -> Sexp.t -> ('k, 'v, 'cmp) tmodule Tree : sig ... endval invariants : (_, _, _) t -> boolval is_empty : (_, _, _) t -> boolval length : (_, _, _) t -> intval find_multi : ('a, 'b list, 'cmp) t -> 'a -> 'b listval find : ('a, 'b, 'cmp) t -> 'a -> 'b optionval find_exn : ('a, 'b, 'cmp) t -> 'a -> 'bval mem : ('a, 'b, 'cmp) t -> 'a -> boolval iter_keys : ('a, _, 'cmp) t -> f:('a -> unit) -> unitval iter : (_, 'b, 'cmp) t -> f:('b -> unit) -> unitval iteri : ('a, 'b, 'cmp) t -> f:(key:'a -> data:'b -> unit) -> unitval iteri_until : ('a, 'b, 'cmp) t -> f:(key:'a -> data:'b -> Base__Map_intf.Continue_or_stop.t) -> Base__Map_intf.Finished_or_unfinished.tval fold : ('a, 'b, _) t -> init:'c -> f:(key:'a -> data:'b -> 'c -> 'c) -> 'cval fold_right : ('a, 'b, _) t -> init:'c -> f:(key:'a -> data:'b -> 'c -> 'c) -> 'cval combine_errors : ('a, 'b Or_error.t, 'cmp) t -> ('a, 'b, 'cmp) t Or_error.tval keys : ('a, _, _) t -> 'a listval data : (_, 'b, _) t -> 'b listval to_alist : ?key_order:[ `Increasing | `Decreasing ] ->
('a, 'b, _) t -> ('a * 'b) listval validate : name:('a -> string) -> 'b Validate.check -> ('a, 'b, _) t Validate.checkval validatei : name:('a -> string) -> ('a * 'b) Validate.check -> ('a, 'b, _) t Validate.checkval symmetric_diff : ('a, 'b, 'cmp) t -> ('a, 'b, 'cmp) t -> data_equal:('b -> 'b -> bool)
-> ('a * [ `Left of 'b | `Right of 'b | `Unequal of 'b * 'b ]) Sequence.tval min_elt : ('a, 'b, 'cmp) t -> ('a * 'b) optionval min_elt_exn : ('a, 'b, 'cmp) t -> 'a * 'bval max_elt : ('a, 'b, 'cmp) t -> ('a * 'b) optionval max_elt_exn : ('a, 'b, 'cmp) t -> 'a * 'bval for_all : (_, 'b, _) t -> f:('b -> bool) -> boolval for_alli : ('a, 'b, _) t -> f:(key:'a -> data:'b -> bool) -> boolval exists : (_, 'b, _) t -> f:('b -> bool) -> boolval existsi : ('a, 'b, _) t -> f:(key:'a -> data:'b -> bool) -> boolval count : (_, 'b, _) t -> f:('b -> bool) -> intval counti : ('a, 'b, _) t -> f:(key:'a -> data:'b -> bool) -> intval subrange : ('k, 'v, 'cmp) t -> lower_bound:'k Maybe_bound.t -> upper_bound:'k Maybe_bound.t ->
('k, 'v, 'cmp) tval fold_range_inclusive : ('a, 'b, _) t -> min:'a -> max:'a -> init:'c -> f:(key:'a
-> data:'b -> 'c -> 'c) -> 'cval range_to_alist : ('a, 'b, _) t -> min:'a -> max:'a -> ('a * 'b) listval closest_key : ('a, 'b, _) t -> [ `Greater_or_equal_to | `Greater_than | `Less_or_equal_to | `Less_than ] -> 'a -> ('a * 'b) optionval nth : ('a, 'b, _) t -> int -> ('a * 'b) optionval nth_exn : ('a, 'b, _) t -> int -> 'a * 'bval rank : ('a, _, _) t -> 'a -> int optionval to_sequence : ?order:[ `Increasing_key | `Decreasing_key ] ->
?keys_greater_or_equal_to:'a -> ?keys_less_or_equal_to:'a ->
('a, 'b, _) t -> ('a * 'b) Sequence.tval binary_search : ('k, 'v, _) t -> compare:(key:'k -> data:'v -> 'key -> int) ->
[ `Last_strictly_less_than | `Last_less_than_or_equal_to | `Last_equal_to | `First_equal_to | `First_greater_than_or_equal_to | `First_strictly_greater_than ] -> 'key -> ('k * 'v) optionval binary_search_segmented : ('k, 'v, _) t -> segment_of:(key:'k -> data:'v ->
[ `Left | `Right ]) -> [ `Last_on_left | `First_on_right ] -> ('k * 'v) optionval empty : comparator:('a, 'cmp) Comparator.t -> ('a, _, 'cmp) tval singleton : comparator:('a, 'cmp) Comparator.t -> 'a -> 'b -> ('a, 'b, 'cmp) tval of_alist : comparator:('a, 'cmp) Comparator.t ->
('a * 'b) list -> [ `Ok of ('a, 'b, 'cmp) t | `Duplicate_key of 'a ]val of_alist_or_error : comparator:('a, 'cmp) Comparator.t ->
('a * 'b) list -> ('a, 'b, 'cmp) t Or_error.tval of_alist_exn : comparator:('a, 'cmp) Comparator.t -> ('a * 'b) list -> ('a, 'b, 'cmp) tval of_alist_multi : comparator:('a, 'cmp) Comparator.t ->
('a * 'b) list -> ('a, 'b list, 'cmp) tval of_alist_fold : comparator:('a, 'cmp) Comparator.t -> ('a * 'b) list -> init:'c ->
f:('c -> 'b -> 'c) -> ('a, 'c, 'cmp) tval of_alist_reduce : comparator:('a, 'cmp) Comparator.t -> ('a * 'b) list -> f:('b -> 'b -> 'b)
-> ('a, 'b, 'cmp) tval of_sorted_array : comparator:('a, 'cmp) Comparator.t ->
('a * 'b) array -> ('a, 'b, 'cmp) t Or_error.tval of_sorted_array_unchecked : comparator:('a, 'cmp) Comparator.t ->
('a * 'b) array -> ('a, 'b, 'cmp) tval of_increasing_iterator_unchecked : comparator:('a, 'cmp) Comparator.t -> len:int ->
f:(int -> 'a * 'b) -> ('a, 'b, 'cmp) tval of_increasing_sequence : comparator:('a, 'cmp) Comparator.t ->
('a * 'b) Sequence.t -> ('a, 'b, 'cmp) t Or_error.tval of_sequence : comparator:('a, 'cmp) Comparator.t ->
('a * 'b) Sequence.t -> [ `Ok of ('a, 'b, 'cmp) t | `Duplicate_key of 'a ]val of_sequence_or_error : comparator:('a, 'cmp) Comparator.t ->
('a * 'b) Sequence.t -> ('a, 'b, 'cmp) t Or_error.tval of_sequence_exn : comparator:('a, 'cmp) Comparator.t -> ('a * 'b) Sequence.t -> ('a, 'b, 'cmp) tval of_sequence_multi : comparator:('a, 'cmp) Comparator.t ->
('a * 'b) Sequence.t -> ('a, 'b list, 'cmp) tval of_sequence_fold : comparator:('a, 'cmp) Comparator.t -> ('a * 'b) Sequence.t -> init:'c ->
f:('c -> 'b -> 'c) -> ('a, 'c, 'cmp) tval of_sequence_reduce : comparator:('a, 'cmp) Comparator.t -> ('a * 'b) Sequence.t -> f:('b -> 'b -> 'b) ->
('a, 'b, 'cmp) tval of_iteri : comparator:('a, 'cmp) 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) Comparator.t -> ('a, 'b, 'cmp) Tree.t -> ('a, 'b, 'cmp) tval comparator : ('a, _, 'cmp) t -> ('a, 'cmp) Comparator.tval hash_fold_direct : 'k Hash.folder -> 'v Hash.folder -> ('k, 'v, 'cmp) t Hash.foldermodule Empty_without_value_restriction (K : Comparator.S1) : sig ... endTo get around the value restriction, apply the functor and include it. You can see an example of this in the Poly submodule below.