You are currently looking at the < v8.2.0 docs (Reason v3.6 syntax edition). You can find the latest API docs here.
(These docs cover all versions between v3 to v8 and are equivalent to the old BuckleScript docs before the rebrand)
MutableMapInt
key
REtype key = int;
t
REtype t('a);
make
RElet make: unit => t('a);
clear
RElet clear: t('a) => unit;
isEmpty
RElet isEmpty: t('a) => bool;
has
RElet has: (t('a), key) => bool;
cmpU
RElet cmpU: (t('a), t('a), [@bs] (('a, 'a) => int)) => int;
cmp
RElet cmp: (t('a), t('a), ('a, 'a) => int) => int;
cmp(m1, m2, cmp)
First compare by size, if size is the same, compare by key, value pair.
eqU
RElet eqU: (t('a), t('a), [@bs] (('a, 'a) => bool)) => bool;
eq
RElet eq: (t('a), t('a), ('a, 'a) => bool) => bool;
eq(m1, m2, cmp)
forEachU
RElet forEachU: (t('a), [@bs] ((key, 'a) => unit)) => unit;
forEach
RElet forEach: (t('a), (key, 'a) => unit) => unit;
forEach(m, f)
applies f
to all bindings in map m
. f
receives the key as first argument, and the associated value as second argument. The application order of f
is in increasing order.
reduceU
RElet reduceU: (t('a), 'b, [@bs] (('b, key, 'a) => 'b)) => 'b;
reduce
RElet reduce: (t('a), 'b, ('b, key, 'a) => 'b) => 'b;
reduce(m, a, f), computes
(f(kN, dN) ... (f(k1, d1, a))...), where
k1 ... kNare the keys of all bindings in
m(in increasing order), and
d1 ... dN` are the associated data.
everyU
RElet everyU: (t('a), [@bs] ((key, 'a) => bool)) => bool;
every
RElet every: (t('a), (key, 'a) => bool) => bool;
every(m, p)
checks if all the bindings of the map satisfy the predicate p
. The application order of p
is unspecified.
someU
RElet someU: (t('a), [@bs] ((key, 'a) => bool)) => bool;
some
RElet some: (t('a), (key, 'a) => bool) => bool;
some(m, p)
checks if at least one binding of the map satisfy the predicate p
. The application order of p
is unspecified.
size
RElet size: t('a) => int;
toList
RElet toList: t('a) => list((key, 'a));
In increasing order
toArray
RElet toArray: t('a) => array((key, 'a));
fromArray
RElet fromArray: array((key, 'a)) => t('a);
keysToArray
RElet keysToArray: t('a) => array(key);
valuesToArray
RElet valuesToArray: t('a) => array('a);
minKey
RElet minKey: t('a) => option(key);
minKeyUndefined
RElet minKeyUndefined: t('a) => Js.undefined(key);
maxKey
RElet maxKey: t('a) => option(key);
maxKeyUndefined
RElet maxKeyUndefined: t('a) => Js.undefined(key);
minimum
RElet minimum: t('a) => option((key, 'a));
minUndefined
RElet minUndefined: t('a) => Js.undefined((key, 'a));
maximum
RElet maximum: t('a) => option((key, 'a));
maxUndefined
RElet maxUndefined: t('a) => Js.undefined((key, 'a));
get
RElet get: (t('a), key) => option('a);
getUndefined
RElet getUndefined: (t('a), key) => Js.undefined('a);
getWithDefault
RElet getWithDefault: (t('a), key, 'a) => 'a;
getExn
RElet getExn: (t('a), key) => 'a;
checkInvariantInternal
RElet checkInvariantInternal: t('a) => unit;
Raise when invariant is not held.
remove
RElet remove: (t('a), key) => unit;
remove(m, x)
do the in-place modification.
removeMany
RElet removeMany: (t('a), array(key)) => unit;
set
RElet set: (t('a), key, 'a) => unit;
set(m, x, y)
do the in-place modification, return m
for chaining. If x
was already bound in m
, its previous binding disappears.
updateU
RElet updateU: (t('a), key, [@bs] (option('a) => option('a))) => unit;
update
RElet update: (t('a), key, option('a) => option('a)) => unit;
mapU
RElet mapU: (t('a), [@bs] ('a => 'b)) => t('b);
map
RElet map: (t('a), 'a => 'b) => t('b);
map(m, f)
returns a map with same domain as m
, where the associated value a of all bindings of m
has been replaced by the result of the application of f
to a
. The bindings are passed to f
in increasing order with respect to the ordering over the type of the keys.
mapWithKeyU
RElet mapWithKeyU: (t('a), [@bs] ((key, 'a) => 'b)) => t('b);
mapWithKey
RElet mapWithKey: (t('a), (key, 'a) => 'b) => t('b);