package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Analog to Incr_map functions in Bonsai. In general, you should prefer to use Bonsai.assoc where possible. For functions that are particularly easy to implement in terms of assoc, the function is stubbed with a `Use_assoc value instead. We also skip wrapping the prime versions of Incr_map functions, since they more easily allow Incr.bind, which we want to make sure is used only when absolutely necessary.

val mapi : [ `Use_assoc ]
val map : [ `Use_assoc ]
val of_set : ('k, 'cmp) Core.Set.t Value.t -> ('k, unit, 'cmp) Core.Map.t Computation.t
val filter_mapi : ('k, 'v1, 'cmp) Core.Map.t Value.t -> f:(key:'k -> data:'v1 -> 'v2 option) -> ('k, 'v2, 'cmp) Core.Map.t Computation.t
val filter_map : ('k, 'v1, 'cmp) Core.Map.t Value.t -> f:('v1 -> 'v2 option) -> ('k, 'v2, 'cmp) Core.Map.t Computation.t
val partition_mapi : ('k, 'v1, 'cmp) Core.Map.t Value.t -> f:(key:'k -> data:'v1 -> ('v2, 'v3) Core.Either.t) -> (('k, 'v2, 'cmp) Core.Map.t * ('k, 'v3, 'cmp) Core.Map.t) Computation.t
val unordered_fold : ?update:(key:'k -> old_data:'v -> new_data:'v -> 'acc -> 'acc) -> ('k, 'v, 'cmp) Core.Map.t Value.t -> init:'acc -> add:(key:'k -> data:'v -> 'acc -> 'acc) -> remove:(key:'k -> data:'v -> 'acc -> 'acc) -> 'acc Computation.t
val unordered_fold_with_extra : ?update:(key:'k -> old_data:'v -> new_data:'v -> 'acc -> 'extra -> 'acc) -> ('k, 'v, 'e) Core.Map.t Value.t -> 'extra Value.t -> init:'acc -> add:(key:'k -> data:'v -> 'acc -> 'extra -> 'acc) -> remove:(key:'k -> data:'v -> 'acc -> 'extra -> 'acc) -> extra_changed: (old_extra:'extra -> new_extra:'extra -> input:('k, 'v, 'e) Core.Map.t -> 'acc -> 'acc) -> 'acc Computation.t
val cutoff : ('k, 'v, 'cmp) Core.Map.t Value.t -> equal:('v -> 'v -> bool) -> ('k, 'v, 'cmp) Core.Map.t Computation.t
val mapi_count : ('k1, 'v, 'cmp1) Core.Map.t Value.t -> comparator:('k2, 'cmp2) comparator -> f:(key:'k1 -> data:'v -> 'k2) -> ('k2, int, 'cmp2) Core.Map.t Computation.t
val map_count : ('k1, 'v, 'cmp1) Core.Map.t Value.t -> comparator:('k2, 'cmp2) comparator -> f:('v -> 'k2) -> ('k2, int, 'cmp2) Core.Map.t Computation.t
val mapi_min : ('k, 'v, _) Core.Map.t Value.t -> comparator:('r, _) comparator -> f:(key:'k -> data:'v -> 'r) -> 'r option Computation.t
val mapi_max : ('k, 'v, _) Core.Map.t Value.t -> comparator:('r, _) comparator -> f:(key:'k -> data:'v -> 'r) -> 'r option Computation.t
val map_min : ('k, 'v, _) Core.Map.t Value.t -> comparator:('r, _) comparator -> f:('v -> 'r) -> 'r option Computation.t
val map_max : ('k, 'v, _) Core.Map.t Value.t -> comparator:('r, _) comparator -> f:('v -> 'r) -> 'r option Computation.t
val min_value : ('k, 'v, _) Core.Map.t Value.t -> comparator:('v, _) comparator -> 'v option Computation.t
val max_value : ('k, 'v, _) Core.Map.t Value.t -> comparator:('v, _) comparator -> 'v option Computation.t
val mapi_bounds : ('k, 'v, _) Core.Map.t Value.t -> comparator:('r, _) comparator -> f:(key:'k -> data:'v -> 'r) -> ('r * 'r) option Computation.t
val map_bounds : ('k, 'v, _) Core.Map.t Value.t -> comparator:('r, _) comparator -> f:('v -> 'r) -> ('r * 'r) option Computation.t
val value_bounds : ('k, 'v, _) Core.Map.t Value.t -> comparator:('v, _) comparator -> ('v * 'v) option Computation.t
val merge : ('k, 'v1, 'cmp) Core.Map.t Value.t -> ('k, 'v2, 'cmp) Core.Map.t Value.t -> f:(key:'k -> ('v1, 'v2) Core.Map.Merge_element.t -> 'v3 option) -> ('k, 'v3, 'cmp) Core.Map.t Computation.t
val merge_both_some : ('k, 'v1, 'cmp) Core.Map.t Value.t -> ('k, 'v2, 'cmp) Core.Map.t Value.t -> f:(key:'k -> 'v1 -> 'v2 -> 'v3) -> ('k, 'v3, 'cmp) Core.Map.t Computation.t
val unzip : ('k, 'a * 'b, 'cmp) Core.Map.t Value.t -> (('k, 'a, 'cmp) Core.Map.t * ('k, 'b, 'cmp) Core.Map.t) Computation.t
val unzip_mapi : ('k, 'v, 'cmp) Core.Map.t Value.t -> f:(key:'k -> data:'v -> 'v1 * 'v2) -> (('k, 'v1, 'cmp) Core.Map.t * ('k, 'v2, 'cmp) Core.Map.t) Computation.t
val keys : ('k, 'v, 'c) Core.Map.t Value.t -> ('k, 'c) Core.Set.t Computation.t
val rank : ('k, 'v, 'cmp) Core.Map.t Value.t -> 'k Value.t -> int option Computation.t
val subrange_by_rank : ('k, 'v, 'cmp) Core.Map.t Value.t -> (int Core.Maybe_bound.As_lower_bound.t * int Core.Maybe_bound.As_upper_bound.t) Value.t -> ('k, 'v, 'cmp) Core.Map.t Computation.t
val rekey : ('k1, 'v, 'cmp1) Core.Map.t Value.t -> comparator:('k2, 'cmp2) comparator -> f:(key:'k1 -> data:'v -> 'k2) -> ('k2, 'v, 'cmp2) Core.Map.t Computation.t
val index_byi : ('inner_key, 'v, 'inner_cmp) Core.Map.t Value.t -> comparator:('outer_key, 'outer_cmp) comparator -> index:(key:'inner_key -> data:'v -> 'outer_key option) -> ('outer_key, ('inner_key, 'v, 'inner_cmp) Core.Map.t, 'outer_cmp) Core.Map.t Computation.t
val index_by : ('inner_key, 'v, 'inner_cmp) Core.Map.t Value.t -> comparator:('outer_key, 'outer_cmp) comparator -> index:('v -> 'outer_key option) -> ('outer_key, ('inner_key, 'v, 'inner_cmp) Core.Map.t, 'outer_cmp) Core.Map.t Computation.t
val unordered_fold_nested_maps : ?update: (outer_key:'outer_key -> inner_key:'inner_key -> old_data:'v -> new_data:'v -> 'acc -> 'acc) -> ('outer_key, ('inner_key, 'v, 'inner_cmp) Core.Map.t, 'outer_cmp) Core.Map.t Value.t -> init:'acc -> add:(outer_key:'outer_key -> inner_key:'inner_key -> data:'v -> 'acc -> 'acc) -> remove: (outer_key:'outer_key -> inner_key:'inner_key -> data:'v -> 'acc -> 'acc) -> 'acc Computation.t
val transpose : ('k2, 'k2_cmp) comparator -> ('k1, ('k2, 'v, 'k2_cmp) Core.Map.t, 'k1_cmp) Core.Map.t Value.t -> ('k2, ('k1, 'v, 'k1_cmp) Core.Map.t, 'k2_cmp) Core.Map.t Computation.t
val collapse : ('outer_key, ('inner_key, 'v, 'inner_cmp) Core.Map.t, 'outer_cmp) Core.Map.t Value.t -> comparator:('inner_key, 'inner_cmp) comparator -> ('outer_key * 'inner_key, 'v, ('outer_cmp, 'inner_cmp) Core.Tuple2.comparator_witness) Core.Map.t Computation.t
val collapse_by : ('outer_key, ('inner_key, 'v, 'inner_cmp) Core.Map.t, 'outer_cmp) Core.Map.t Value.t -> merge_keys:('outer_key -> 'inner_key -> 'combined_key) -> comparator:('combined_key, 'combined_cmp) comparator -> ('combined_key, 'v, 'combined_cmp) Core.Map.t Computation.t
val expand : ('outer_key * 'inner_key, 'v, 'tuple_cmp) Core.Map.t Value.t -> outer_comparator:('outer_key, 'outer_cmp) comparator -> inner_comparator:('inner_key, 'inner_cmp) comparator -> ('outer_key, ('inner_key, 'v, 'inner_cmp) Core.Map.t, 'outer_cmp) Core.Map.t Computation.t
val counti : ('k, 'v, _) Core.Map.t Value.t -> f:(key:'k -> data:'v -> bool) -> int Computation.t
val count : (_, 'v, _) Core.Map.t Value.t -> f:('v -> bool) -> int Computation.t
val for_alli : ('k, 'v, _) Core.Map.t Value.t -> f:(key:'k -> data:'v -> bool) -> bool Computation.t
val for_all : (_, 'v, _) Core.Map.t Value.t -> f:('v -> bool) -> bool Computation.t
val existsi : ('k, 'v, _) Core.Map.t Value.t -> f:(key:'k -> data:'v -> bool) -> bool Computation.t
val exists : (_, 'v, _) Core.Map.t Value.t -> f:('v -> bool) -> bool Computation.t
val sum : (_, 'v, _) Core.Map.t Value.t -> (module Abstract_algebra.Commutative_group.Without_sexp with type t = 'u) -> f:('v -> 'u) -> 'u Computation.t
OCaml

Innovation. Community. Security.