Int
This module is Belt.MutableSet specialized with key type to be a primitive type.
It is more efficient in general, the API is the same with Belt.MutableSet except its key type is fixed,
and identity is not needed(using the built-in one)
See Belt.MutableSet
add
let add: (t, value) => unitaddCheck
let addCheck: (t, value) => boolcheckInvariantInternal
let checkInvariantInternal: t => unitthrow when invariant is not held
cmp
let cmp: (t, t) => intcopy
let copy: t => tdiff
let diff: (t, t) => teq
let eq: (t, t) => boolevery
let every: (t, value => bool) => boolevery(p, s) checks if all elements of the set satisfy the predicate p.
Order unspecified.
everyU
Deprecated
Use every instead
let everyU: (t, value => bool) => boolforEach
let forEach: (t, value => unit) => unitIn increasing order
forEachU
Deprecated
Use forEach instead
let forEachU: (t, value => unit) => unitfromArray
let fromArray: array<value> => tfromSortedArrayUnsafe
let fromSortedArrayUnsafe: array<value> => tget
let get: (t, value) => option<value>getExn
let getExn: (t, value) => valuegetOrThrow
let getOrThrow: (t, value) => valuegetUndefined
let getUndefined: (t, value) => Js.undefined<value>has
let has: (t, value) => boolintersect
let intersect: (t, t) => tisEmpty
let isEmpty: t => boolkeep
let keep: (t, value => bool) => tkeep(s, p) returns a fresh copy of the set of all elements in s that satisfy
predicate p.
keepU
Deprecated
Use keep instead
let keepU: (t, value => bool) => tmake
let make: unit => tmaximum
let maximum: t => option<value>maxUndefined
let maxUndefined: t => Js.undefined<value>mergeMany
let mergeMany: (t, array<value>) => unitminimum
let minimum: t => option<value>minUndefined
let minUndefined: t => Js.undefined<value>partition
let partition: (t, value => bool) => (t, t)partition(s, p) returns a fresh copy pair of sets (s1, s2), where s1 is
the set of all the elements of s that satisfy the predicate p, and s2 is
the set of all the elements of s that do not satisfy p.
partitionU
Deprecated
Use partition instead
let partitionU: (t, value => bool) => (t, t)reduce
let reduce: (t, 'a, ('a, value) => 'a) => 'aIterate in increasing order.
reduceU
Deprecated
Use reduce instead
let reduceU: (t, 'a, ('a, value) => 'a) => 'aremove
let remove: (t, value) => unitremoveCheck
let removeCheck: (t, value) => boolremoveMany
let removeMany: (t, array<value>) => unitsize
let size: t => intsome
let some: (t, value => bool) => boolsome(p, s) checks if at least one element of the set satisfies the predicate
p. Oder unspecified.
someU
Deprecated
Use some instead
let someU: (t, value => bool) => boolsplit
let split: (t, value) => ((t, t), bool)split(s, key) return a fresh copy of each
subset
let subset: (t, t) => boolt
type tThe type of sets.
toArray
let toArray: t => array<value>In increasing order with respect
toList
let toList: t => list<value>In increasing order with respect
union
let union: (t, t) => tvalue
type value = intThe type of the set elements.