module Core_map_intf:sig
..end
Core.Std.Map
. See the documentation in
core_map.mli for a description of the approach.val __pa_ounit_275876e34cf609db118f3d84b799a790 : string
Core.Std.Map
. See the documentation in
core_map.mli for a description of the approach.module Binable: Binable0
module List: List
module type Key = Comparator.Pre
module type Key_binable = Comparator.Pre_binable
type('key, 'comparator, 'z)
without_comparator ='z
type('key, 'comparator, 'z)
with_comparator =comparator:('key, 'comparator) Comparator.t -> 'z
module type Accessors =sig
..end
module type Creators =sig
..end
module type Creators_and_accessors =sig
..end
module type S =sig
..end
module type S_binable =sig
..end
Core.Std.Map
. See the documentation in
core_map.mli for a description of the approach.length map
change map key f
updates the given map by changing the value stored
under key
according to f
. Thus, for example, one might write:
change m k (function None -> Some 0 | Some x -> Some (x + 1))
to produce a new map where the integer stored under key k
is
incremented by one (treating an unknown key as zero)
returns the value bound to the given key, raising Not_found
if none
such exists
returns a new map with any binding for the key in question removed
mem map key
tests whether map
contains a binding for key
iterator for map
Iterate two maps side by side. Complexity of this function is O(M+N). If two inputs
are (0, a); (1, a)
and (1, b); (2, b)
, f
will be called with
(0, `Left a); (1, `Both (a, b)); (2, `Right b)
returns new map with bound values replaced by f applied to the bound values
like map
, but function takes both key and data as arguments
folds over keys and data in map in increasing order of key.
folds over keys and data in map in decreasing order of key.
returns new map with bound values filtered by f applied to the bound values
like filter_map
, but function takes both key and data as arguments
Total ordering between maps. The first argument is a total ordering used to compare
data associated with equal keys in the two maps.
equal cmp m1 m2
tests whether the maps m1
and m2
are equal, that is, contain
equal keys and associate them with equal data. cmp
is the equality predicate used
to compare the data associated with the keys.
returns list of keys in map
returns list of data in map
creates association list from map. No guarantee about order.
symmetric_diff t1 t2 ~data_equal
returns a list of changes between t1 and t2. It
is intended to be efficient in the case where t1 and t2 share a large amount of
structure.min_elt map
max_elt map
fold_range_inclusive t ~min ~max ~init ~f
folds f (with initial value ~init) over all keys (and their associated values)
that are in the range min, max
(inclusive).range_to_alist t ~min ~max
returns an associative list of the elements whose
keys lie in min, max
(inclusive), with the smallest key being at the head of the
list.prev_key t k
returns the largest (key, value) pair in t with key less than knext_key t k
returns the smallest (key, value) pair in t with key greater than krank t k
if k is in t, returns the number of keys strictly less than k in t,
otherwise Noneof_sorted_array
except behavior is undefined when an Error
would have been
returned.