Using_comparator.Tree
val sexp_of_t :
('k -> Sexplib0.Sexp.t) ->
('v -> Sexplib0.Sexp.t) ->
('cmp -> Sexplib0.Sexp.t) ->
('k, 'v, 'cmp) t ->
Sexplib0.Sexp.t
val t_of_sexp_direct :
comparator:('k, 'cmp) Comparator.t ->
(Sexp.t -> 'k) ->
(Sexp.t -> 'v) ->
Sexp.t ->
('k, 'v, 'cmp) t
val empty : comparator:('k, 'cmp) Comparator.t -> ('k, _, 'cmp) t
val singleton :
comparator:('k, 'cmp) Comparator.t ->
'k ->
'v ->
('k, 'v, 'cmp) t
val map_keys :
comparator:('k2, 'cmp2) Comparator.t ->
('k1, 'v, 'cmp1) t ->
f:('k1 -> 'k2) ->
[ `Ok of ('k2, 'v, 'cmp2) t | `Duplicate_key of 'k2 ]
val map_keys_exn :
comparator:('k2, 'cmp2) Comparator.t ->
('k1, 'v, 'cmp1) t ->
f:('k1 -> 'k2) ->
('k2, 'v, 'cmp2) t
val transpose_keys :
comparator:('k1, 'cmp1) Comparator.t ->
comparator:('k2, 'cmp2) Comparator.t ->
('k1, ('k2, 'a, 'cmp2) t, 'cmp1) t ->
('k2, ('k1, 'a, 'cmp1) t, 'cmp2) t
val of_sorted_array :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) array ->
('k, 'v, 'cmp) t Or_error.t
val of_sorted_array_unchecked :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) array ->
('k, 'v, 'cmp) t
val of_increasing_iterator_unchecked :
comparator:('k, 'cmp) Comparator.t ->
len:int ->
f:(int -> 'k * 'v) ->
('k, 'v, 'cmp) t
val of_alist :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) list ->
[ `Ok of ('k, 'v, 'cmp) t | `Duplicate_key of 'k ]
val of_alist_or_error :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) list ->
('k, 'v, 'cmp) t Or_error.t
val of_alist_exn :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) list ->
('k, 'v, 'cmp) t
val of_alist_multi :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) list ->
('k, 'v list, 'cmp) t
val of_alist_fold :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v1) list ->
init:'v2 ->
f:('v2 -> 'v1 -> 'v2) ->
('k, 'v2, 'cmp) t
val of_alist_reduce :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) list ->
f:('v -> 'v -> 'v) ->
('k, 'v, 'cmp) t
val of_increasing_sequence :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) Sequence.t ->
('k, 'v, 'cmp) t Or_error.t
val of_sequence :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) Sequence.t ->
[ `Ok of ('k, 'v, 'cmp) t | `Duplicate_key of 'k ]
val of_sequence_or_error :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) Sequence.t ->
('k, 'v, 'cmp) t Or_error.t
val of_sequence_exn :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) Sequence.t ->
('k, 'v, 'cmp) t
val of_sequence_multi :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) Sequence.t ->
('k, 'v list, 'cmp) t
val of_sequence_fold :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v1) Sequence.t ->
init:'v2 ->
f:('v2 -> 'v1 -> 'v2) ->
('k, 'v2, 'cmp) t
val of_sequence_reduce :
comparator:('k, 'cmp) Comparator.t ->
('k * 'v) Sequence.t ->
f:('v -> 'v -> 'v) ->
('k, 'v, 'cmp) t
val of_list_with_key :
comparator:('k, 'cmp) Comparator.t ->
'v list ->
get_key:('v -> 'k) ->
[ `Ok of ('k, 'v, 'cmp) t | `Duplicate_key of 'k ]
val of_list_with_key_or_error :
comparator:('k, 'cmp) Comparator.t ->
'v list ->
get_key:('v -> 'k) ->
('k, 'v, 'cmp) t Or_error.t
val of_list_with_key_exn :
comparator:('k, 'cmp) Comparator.t ->
'v list ->
get_key:('v -> 'k) ->
('k, 'v, 'cmp) t
val of_list_with_key_multi :
comparator:('k, 'cmp) Comparator.t ->
'v list ->
get_key:('v -> 'k) ->
('k, 'v list, 'cmp) t
val of_iteri :
comparator:('k, 'cmp) Comparator.t ->
iteri:(f:(key:'k -> data:'v -> unit) -> unit) ->
[ `Ok of ('k, 'v, 'cmp) t | `Duplicate_key of 'k ]
val of_iteri_exn :
comparator:('k, 'cmp) Comparator.t ->
iteri:(f:(key:'k -> data:'v -> unit) -> unit) ->
('k, 'v, 'cmp) t
val of_tree :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
('k, 'v, 'cmp) t
val invariants : comparator:('k, 'cmp) Comparator.t -> ('k, 'v, 'cmp) t -> bool
val is_empty : (_, _, _) t -> bool
val length : (_, _, _) t -> int
val add :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
key:'k ->
data:'v ->
[ `Ok of ('k, 'v, 'cmp) t | `Duplicate ]
val add_exn :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
key:'k ->
data:'v ->
('k, 'v, 'cmp) t
val set :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
key:'k ->
data:'v ->
('k, 'v, 'cmp) t
val add_multi :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v list, 'cmp) t ->
key:'k ->
data:'v ->
('k, 'v list, 'cmp) t
val remove_multi :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v list, 'cmp) t ->
'k ->
('k, 'v list, 'cmp) t
val find_multi :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v list, 'cmp) t ->
'k ->
'v list
val change :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
'k ->
f:('v option -> 'v option) ->
('k, 'v, 'cmp) t
val update :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
'k ->
f:('v option -> 'v) ->
('k, 'v, 'cmp) t
val find :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
'k ->
'v option
val find_exn :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
'k ->
'v
val remove :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
'k ->
('k, 'v, 'cmp) t
val mem : comparator:('k, 'cmp) Comparator.t -> ('k, _, 'cmp) t -> 'k -> bool
val iter_keys : ('k, _, _) t -> f:('k -> unit) -> unit
val iter : (_, 'v, _) t -> f:('v -> unit) -> unit
val iteri : ('k, 'v, _) t -> f:(key:'k -> data:'v -> unit) -> unit
val iteri_until :
('k, 'v, _) t ->
f:(key:'k -> data:'v -> Continue_or_stop.t) ->
Finished_or_unfinished.t
val iter2 :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v1, 'cmp) t ->
('k, 'v2, 'cmp) t ->
f:
(key:'k ->
data:[ `Left of 'v1 | `Right of 'v2 | `Both of 'v1 * 'v2 ] ->
unit) ->
unit
val fold :
('k, 'v, _) t ->
init:'acc ->
f:(key:'k -> data:'v -> 'acc -> 'acc) ->
'acc
val fold_until :
('k, 'v, _) t ->
init:'acc ->
f:(key:'k -> data:'v -> 'acc -> ('acc, 'final) Container.Continue_or_stop.t) ->
finish:('acc -> 'final) ->
'final
val fold_right :
('k, 'v, _) t ->
init:'acc ->
f:(key:'k -> data:'v -> 'acc -> 'acc) ->
'acc
val fold2 :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v1, 'cmp) t ->
('k, 'v2, 'cmp) t ->
init:'acc ->
f:
(key:'k ->
data:[ `Left of 'v1 | `Right of 'v2 | `Both of 'v1 * 'v2 ] ->
'acc ->
'acc) ->
'acc
val combine_errors :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v Or_error.t, 'cmp) t ->
('k, 'v, 'cmp) t Or_error.t
val compare_direct :
comparator:('k, 'cmp) Comparator.t ->
('v -> 'v -> int) ->
('k, 'v, 'cmp) t ->
('k, 'v, 'cmp) t ->
int
val equal :
comparator:('k, 'cmp) Comparator.t ->
('v -> 'v -> bool) ->
('k, 'v, 'cmp) t ->
('k, 'v, 'cmp) t ->
bool
val keys : ('k, _, _) t -> 'k list
val data : (_, 'v, _) t -> 'v list
val to_alist :
?key_order:[ `Increasing | `Decreasing ] ->
('k, 'v, _) t ->
('k * 'v) list
val merge :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v1, 'cmp) t ->
('k, 'v2, 'cmp) t ->
f:
(key:'k ->
[ `Left of 'v1 | `Right of 'v2 | `Both of 'v1 * 'v2 ] ->
'v3 option) ->
('k, 'v3, 'cmp) t
val merge_skewed :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
('k, 'v, 'cmp) t ->
combine:(key:'k -> 'v -> 'v -> 'v) ->
('k, 'v, 'cmp) t
val symmetric_diff :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
('k, 'v, 'cmp) t ->
data_equal:('v -> 'v -> bool) ->
('k * [ `Left of 'v | `Right of 'v | `Unequal of 'v * 'v ]) Sequence.t
val fold_symmetric_diff :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
('k, 'v, 'cmp) t ->
data_equal:('v -> 'v -> bool) ->
init:'acc ->
f:
('acc ->
('k * [ `Left of 'v | `Right of 'v | `Unequal of 'v * 'v ]) ->
'acc) ->
'acc
val min_elt : ('k, 'v, _) t -> ('k * 'v) option
val min_elt_exn : ('k, 'v, _) t -> 'k * 'v
val max_elt : ('k, 'v, _) t -> ('k * 'v) option
val max_elt_exn : ('k, 'v, _) t -> 'k * 'v
val for_all : ('k, 'v, _) t -> f:('v -> bool) -> bool
val for_alli : ('k, 'v, _) t -> f:(key:'k -> data:'v -> bool) -> bool
val exists : ('k, 'v, _) t -> f:('v -> bool) -> bool
val existsi : ('k, 'v, _) t -> f:(key:'k -> data:'v -> bool) -> bool
val count : ('k, 'v, _) t -> f:('v -> bool) -> int
val counti : ('k, 'v, _) t -> f:(key:'k -> data:'v -> bool) -> int
val split :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
'k ->
('k, 'v, 'cmp) t * ('k * 'v) option * ('k, 'v, 'cmp) t
val split_le_gt :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
'k ->
('k, 'v, 'cmp) t * ('k, 'v, 'cmp) t
val split_lt_ge :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
'k ->
('k, 'v, 'cmp) t * ('k, 'v, 'cmp) t
val append :
comparator:('k, 'cmp) Comparator.t ->
lower_part:('k, 'v, 'cmp) t ->
upper_part:('k, 'v, 'cmp) t ->
[ `Ok of ('k, 'v, 'cmp) t | `Overlapping_key_ranges ]
val subrange :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
lower_bound:'k Maybe_bound.t ->
upper_bound:'k Maybe_bound.t ->
('k, 'v, 'cmp) t
val fold_range_inclusive :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
min:'k ->
max:'k ->
init:'acc ->
f:(key:'k -> data:'v -> 'acc -> 'acc) ->
'acc
val range_to_alist :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
min:'k ->
max:'k ->
('k * 'v) list
val closest_key :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
[ `Greater_or_equal_to | `Greater_than | `Less_or_equal_to | `Less_than ] ->
'k ->
('k * 'v) option
val nth : ('k, 'v, 'cmp) t -> int -> ('k * 'v) option
val nth_exn : ('k, 'v, 'cmp) t -> int -> 'k * 'v
val rank :
comparator:('k, 'cmp) Comparator.t ->
('k, _, 'cmp) t ->
'k ->
int option
val to_sequence :
comparator:('k, 'cmp) Comparator.t ->
?order:[ `Increasing_key | `Decreasing_key ] ->
?keys_greater_or_equal_to:'k ->
?keys_less_or_equal_to:'k ->
('k, 'v, 'cmp) t ->
('k * 'v) Sequence.t
val binary_search :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
compare:(key:'k -> data:'v -> 'key -> int) ->
Binary_searchable.Which_target_by_key.t ->
'key ->
('k * 'v) option
val binary_search_segmented :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
segment_of:(key:'k -> data:'v -> [ `Left | `Right ]) ->
Binary_searchable.Which_target_by_segment.t ->
('k * 'v) option
val binary_search_subrange :
comparator:('k, 'cmp) Comparator.t ->
('k, 'v, 'cmp) t ->
compare:(key:'k -> data:'v -> 'bound -> int) ->
lower_bound:'bound Maybe_bound.t ->
upper_bound:'bound Maybe_bound.t ->
('k, 'v, 'cmp) t
module Make_applicative_traversals
(A : Applicative.Lazy_applicative) :
sig ... end
val empty_without_value_restriction : (_, _, _) t
module Build_increasing : sig ... end
Build_increasing
can be used to construct a map incrementally from a sequence that is known to be increasing.