Module Map.Poly

A polymorphic Map.

type ('key, +'value) t = ('key, 'value, Comparator.Poly.comparator_witness) t
type ('key, +'value) tree = ('key, 'value, Comparator.Poly.comparator_witness) Using_comparator.Tree.t
type comparator_witness = Comparator.Poly.comparator_witness
val empty : ('k, _) t
val singleton : 'k -> 'v -> ('k, 'v) t
val map_keys : ('k1, 'v) t -> f:('k1 -> 'k2) -> [ `Ok of ('k2, 'v) t | `Duplicate_key of 'k2 ]
val map_keys_exn : ('k1, 'v) t -> f:('k1 -> 'k2) -> ('k2, 'v) t
val transpose_keys : ('k1, ('k2, 'a) t) t -> ('k2, ('k1, 'a) t) t
val of_sorted_array : ('k * 'v) array -> ('k, 'v) t Or_error.t
val of_sorted_array_unchecked : ('k * 'v) array -> ('k, 'v) t
val of_increasing_iterator_unchecked : len:int -> f:(int -> 'k * 'v) -> ('k, 'v) t
val of_alist : ('k * 'v) list -> [ `Ok of ('k, 'v) t | `Duplicate_key of 'k ]
val of_alist_or_error : ('k * 'v) list -> ('k, 'v) t Or_error.t
val of_alist_exn : ('k * 'v) list -> ('k, 'v) t
val of_alist_multi : ('k * 'v) list -> ('k, 'v list) t
val of_alist_fold : ('k * 'v1) list -> init:'v2 -> f:('v2 -> 'v1 -> 'v2) -> ('k, 'v2) t
val of_alist_reduce : ('k * 'v) list -> f:('v -> 'v -> 'v) -> ('k, 'v) t
val of_increasing_sequence : ('k * 'v) Sequence.t -> ('k, 'v) t Or_error.t
val of_sequence : ('k * 'v) Sequence.t -> [ `Ok of ('k, 'v) t | `Duplicate_key of 'k ]
val of_sequence_or_error : ('k * 'v) Sequence.t -> ('k, 'v) t Or_error.t
val of_sequence_exn : ('k * 'v) Sequence.t -> ('k, 'v) t
val of_sequence_multi : ('k * 'v) Sequence.t -> ('k, 'v list) t
val of_sequence_fold : ('k * 'v1) Sequence.t -> init:'v2 -> f:('v2 -> 'v1 -> 'v2) -> ('k, 'v2) t
val of_sequence_reduce : ('k * 'v) Sequence.t -> f:('v -> 'v -> 'v) -> ('k, 'v) t
val of_list_with_key : 'v list -> get_key:('v -> 'k) -> [ `Ok of ('k, 'v) t | `Duplicate_key of 'k ]
val of_list_with_key_or_error : 'v list -> get_key:('v -> 'k) -> ('k, 'v) t Or_error.t
val of_list_with_key_exn : 'v list -> get_key:('v -> 'k) -> ('k, 'v) t
val of_list_with_key_multi : 'v list -> get_key:('v -> 'k) -> ('k, 'v list) t
val of_iteri : iteri:(f:(key:'k -> data:'v -> unit) -> unit) -> [ `Ok of ('k, 'v) t | `Duplicate_key of 'k ]
val of_iteri_exn : iteri:(f:(key:'k -> data:'v -> unit) -> unit) -> ('k, 'v) t
val of_tree : ('k, 'v) tree -> ('k, 'v) t
val invariants : ('k, 'v) t -> bool
val is_empty : (_, _) t -> bool
val length : (_, _) t -> int
val add : ('k, 'v) t -> key:'k -> data:'v -> [ `Ok of ('k, 'v) t | `Duplicate ]
val add_exn : ('k, 'v) t -> key:'k -> data:'v -> ('k, 'v) t
val set : ('k, 'v) t -> key:'k -> data:'v -> ('k, 'v) t
val add_multi : ('k, 'v list) t -> key:'k -> data:'v -> ('k, 'v list) t
val remove_multi : ('k, 'v list) t -> 'k -> ('k, 'v list) t
val find_multi : ('k, 'v list) t -> 'k -> 'v list
val change : ('k, 'v) t -> 'k -> f:('v option -> 'v option) -> ('k, 'v) t
val update : ('k, 'v) t -> 'k -> f:('v option -> 'v) -> ('k, 'v) t
val find : ('k, 'v) t -> 'k -> 'v option
val find_exn : ('k, 'v) t -> 'k -> 'v
val remove : ('k, 'v) t -> 'k -> ('k, 'v) t
val mem : ('k, _) 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 : ('k, 'v1) t -> ('k, 'v2) t -> f: (key:'k -> data:[ `Left of 'v1 | `Right of 'v2 | `Both of 'v1 * 'v2 ] -> unit) -> unit
val map : ('k, 'v1) t -> f:('v1 -> 'v2) -> ('k, 'v2) t
val mapi : ('k, 'v1) t -> f:(key:'k -> data:'v1 -> 'v2) -> ('k, 'v2) t
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 : ('k, 'v1) t -> ('k, 'v2) t -> init:'acc -> f: (key:'k -> data:[ `Left of 'v1 | `Right of 'v2 | `Both of 'v1 * 'v2 ] -> 'acc -> 'acc) -> 'acc
val filter_keys : ('k, 'v) t -> f:('k -> bool) -> ('k, 'v) t
val filter : ('k, 'v) t -> f:('v -> bool) -> ('k, 'v) t
val filteri : ('k, 'v) t -> f:(key:'k -> data:'v -> bool) -> ('k, 'v) t
val filter_map : ('k, 'v1) t -> f:('v1 -> 'v2 option) -> ('k, 'v2) t
val filter_mapi : ('k, 'v1) t -> f:(key:'k -> data:'v1 -> 'v2 option) -> ('k, 'v2) t
val partition_mapi : ('k, 'v1) t -> f:(key:'k -> data:'v1 -> ('v2, 'v3) Either.t) -> ('k, 'v2) t * ('k, 'v3) t
val partition_map : ('k, 'v1) t -> f:('v1 -> ('v2, 'v3) Either.t) -> ('k, 'v2) t * ('k, 'v3) t
val partitioni_tf : ('k, 'v) t -> f:(key:'k -> data:'v -> bool) -> ('k, 'v) t * ('k, 'v) t
val partition_tf : ('k, 'v) t -> f:('v -> bool) -> ('k, 'v) t * ('k, 'v) t
val combine_errors : ('k, 'v Or_error.t) t -> ('k, 'v) t Or_error.t
val compare_direct : ('v -> 'v -> int) -> ('k, 'v) t -> ('k, 'v) t -> int
val equal : ('v -> 'v -> bool) -> ('k, 'v) t -> ('k, 'v) 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 : ('k, 'v1) t -> ('k, 'v2) t -> f: (key:'k -> [ `Left of 'v1 | `Right of 'v2 | `Both of 'v1 * 'v2 ] -> 'v3 option) -> ('k, 'v3) t
val merge_skewed : ('k, 'v) t -> ('k, 'v) t -> combine:(key:'k -> 'v -> 'v -> 'v) -> ('k, 'v) t
val symmetric_diff : ('k, 'v) t -> ('k, 'v) t -> data_equal:('v -> 'v -> bool) -> ('k * [ `Left of 'v | `Right of 'v | `Unequal of 'v * 'v ]) Sequence.t
val fold_symmetric_diff : ('k, 'v) t -> ('k, 'v) 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 : ('k, 'v) t -> 'k -> ('k, 'v) t * ('k * 'v) option * ('k, 'v) t
val split_le_gt : ('k, 'v) t -> 'k -> ('k, 'v) t * ('k, 'v) t
val split_lt_ge : ('k, 'v) t -> 'k -> ('k, 'v) t * ('k, 'v) t
val append : lower_part:('k, 'v) t -> upper_part:('k, 'v) t -> [ `Ok of ('k, 'v) t | `Overlapping_key_ranges ]
val subrange : ('k, 'v) t -> lower_bound:'k Maybe_bound.t -> upper_bound:'k Maybe_bound.t -> ('k, 'v) t
val fold_range_inclusive : ('k, 'v) t -> min:'k -> max:'k -> init:'acc -> f:(key:'k -> data:'v -> 'acc -> 'acc) -> 'acc
val range_to_alist : ('k, 'v) t -> min:'k -> max:'k -> ('k * 'v) list
val closest_key : ('k, 'v) t -> [ `Greater_or_equal_to | `Greater_than | `Less_or_equal_to | `Less_than ] -> 'k -> ('k * 'v) option
val nth : ('k, 'v) t -> int -> ('k * 'v) option
val nth_exn : ('k, 'v) t -> int -> 'k * 'v
val rank : ('k, _) t -> 'k -> int option
val to_tree : ('k, 'v) t -> ('k, 'v) tree
val to_sequence : ?order:[ `Increasing_key | `Decreasing_key ] -> ?keys_greater_or_equal_to:'k -> ?keys_less_or_equal_to:'k -> ('k, 'v) t -> ('k * 'v) Sequence.t
val binary_search_segmented : ('k, 'v) t -> segment_of:(key:'k -> data:'v -> [ `Left | `Right ]) -> Binary_searchable.Which_target_by_segment.t -> ('k * 'v) option
val binary_search_subrange : ('k, 'v) t -> compare:(key:'k -> data:'v -> 'bound -> int) -> lower_bound:'bound Maybe_bound.t -> upper_bound:'bound Maybe_bound.t -> ('k, 'v) t