You are currently looking at the v9.1 - v10.1 docs (Reason v3.6 syntax edition). You can find the latest API docs here.
MapInt
Specialized when key type is int, more efficient than the generic type, its compare behavior is fixed using the built-in comparison
key
REStype key = int
t
REStype t<'value>
The type of maps from type key to type 'value.
empty
RESlet empty: t<'v>
isEmpty
RESlet isEmpty: t<'v> => bool
has
RESlet has: (t<'v>, key) => bool
cmpU
RESlet cmpU: (t<'v>, t<'v>, (. 'v, 'v) => int) => int
cmp
RESlet cmp: (t<'v>, t<'v>, ('v, 'v) => int) => int
eqU
RESlet eqU: (t<'v>, t<'v>, (. 'v, 'v) => bool) => bool
eq
RESlet eq: (t<'v>, t<'v>, ('v, 'v) => bool) => bool
eq(m1,m2) tests whether the maps m1 and m2 are equal, that is, contain equal keys and associate them with equal data.
findFirstByU
RESlet findFirstByU: (t<'v>, (. key, 'v) => bool) => option<(key, 'v)>
findFirstBy
RESlet findFirstBy: (t<'v>, (key, 'v) => bool) => option<(key, 'v)>
findFirstBy(m, p) uses function f to find the first key value pair to match predicate p.
RESlet s0 = Belt.Map.Int.fromArray([(4, "4"), (1, "1"), (2, "2"), (3, "3")])
Belt.Map.Int.findFirstBy(s0, (k, v) => k == 4) == Some((4, "4"))
forEachU
RESlet forEachU: (t<'v>, (. key, 'v) => unit) => unit
forEach
RESlet forEach: (t<'v>, (key, 'v) => 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 bindings are passed to f in increasing order with respect to the ordering over the type of the keys.
reduceU
RESlet reduceU: (t<'v>, 'v2, (. 'v2, key, 'v) => 'v2) => 'v2
reduce
RESlet reduce: (t<'v>, 'v2, ('v2, key, 'v) => 'v2) => 'v2
reduce(m, a, f) computes f(kN, dN, ... f(k1, d1, a)...), where k1 ... kN are the keys of all bindings in m (in increasing order), and d1 ... dN are the associated data.
everyU
RESlet everyU: (t<'v>, (. key, 'v) => bool) => bool
every
RESlet every: (t<'v>, (key, 'v) => bool) => bool
every(m, p) checks if all the bindings of the map satisfy the predicate p. Order unspecified
someU
RESlet someU: (t<'v>, (. key, 'v) => bool) => bool
some
RESlet some: (t<'v>, (key, 'v) => bool) => bool
some(m, p) checks if at least one binding of the map satisfy the predicate p. Order unspecified
size
RESlet size: t<'v> => int
toList
RESlet toList: t<'v> => list<(key, 'v)>
In increasing order.
toArray
RESlet toArray: t<'v> => array<(key, 'v)>
fromArray
RESlet fromArray: array<(key, 'v)> => t<'v>
keysToArray
RESlet keysToArray: t<'v> => array<key>
valuesToArray
RESlet valuesToArray: t<'v> => array<'v>
minKey
RESlet minKey: t<'a> => option<key>
minKeyUndefined
RESlet minKeyUndefined: t<'a> => Js.undefined<key>
maxKey
RESlet maxKey: t<'a> => option<key>
maxKeyUndefined
RESlet maxKeyUndefined: t<'a> => Js.undefined<key>
minimum
RESlet minimum: t<'v> => option<(key, 'v)>
minUndefined
RESlet minUndefined: t<'v> => Js.undefined<(key, 'v)>
maximum
RESlet maximum: t<'v> => option<(key, 'v)>
maxUndefined
RESlet maxUndefined: t<'v> => Js.undefined<(key, 'v)>
get
RESlet get: (t<'v>, key) => option<'v>
getUndefined
RESlet getUndefined: (t<'v>, key) => Js.undefined<'v>
getWithDefault
RESlet getWithDefault: (t<'v>, key, 'v) => 'v
getExn
RESlet getExn: (t<'v>, key) => 'v
checkInvariantInternal
RESlet checkInvariantInternal: t<'a> => unit
raise when invariant is not held
remove
RESlet remove: (t<'v>, key) => t<'v>
remove(m, x) returns a map containing the same bindings as m, except for x which is unbound in the returned map.
removeMany
RESlet removeMany: (t<'v>, array<key>) => t<'v>
set
RESlet set: (t<'v>, key, 'v) => t<'v>
set(m, x, y) returns a map containing the same bindings as m, plus a binding of x to y. If x was already bound in m, its previous binding disappears.
updateU
RESlet updateU: (t<'v>, key, (. option<'v>) => option<'v>) => t<'v>
update
RESlet update: (t<'v>, key, option<'v> => option<'v>) => t<'v>
mergeU
RESlet mergeU: (t<'v>, t<'v2>, (. key, option<'v>, option<'v2>) => option<'c>) => t<'c>
merge
RESlet merge: (t<'v>, t<'v2>, (key, option<'v>, option<'v2>) => option<'c>) => t<'c>
merge(m1, m2, f) computes a map whose keys is a subset of keys of m1 and of m2. The presence of each such binding, and the corresponding value, is determined with the function f.
mergeMany
RESlet mergeMany: (t<'v>, array<(key, 'v)>) => t<'v>
keepU
RESlet keepU: (t<'v>, (. key, 'v) => bool) => t<'v>
keep
RESlet keep: (t<'v>, (key, 'v) => bool) => t<'v>
partitionU
RESlet partitionU: (t<'v>, (. key, 'v) => bool) => (t<'v>, t<'v>)
partition
RESlet partition: (t<'v>, (key, 'v) => bool) => (t<'v>, t<'v>)
partition(m, p) returns a pair of maps (m1, m2), where m1 contains all the bindings of s that satisfy the predicate p, and m2 is the map with all the bindings of s that do not satisfy p.
split
RESlet split: (key, t<'v>) => (t<'v>, option<'v>, t<'v>)
split(x, m) returns a triple (l, data, r), where l is the map with all the bindings of m whose key is strictly less than x; r is the map with all the bindings of m whose key is strictly greater than x; data is None if m contains no binding for x, or Some(v) if m binds v to x.
mapU
RESlet mapU: (t<'v>, (. 'v) => 'v2) => t<'v2>
map
RESlet map: (t<'v>, 'v => 'v2) => t<'v2>
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
RESlet mapWithKeyU: (t<'v>, (. key, 'v) => 'v2) => t<'v2>
mapWithKey
RESlet mapWithKey: (t<'v>, (key, 'v) => 'v2) => t<'v2>