String

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

RES
let add: (t, value) => unit

addCheck

RES
let addCheck: (t, value) => bool

checkInvariantInternal

RES
let checkInvariantInternal: t => unit

throw when invariant is not held

cmp

RES
let cmp: (t, t) => int

copy

RES
let copy: t => t

diff

RES
let diff: (t, t) => t

eq

RES
let eq: (t, t) => bool

every

RES
let every: (t, value => bool) => bool

every(p, s) checks if all elements of the set satisfy the predicate p. Order unspecified.

everyU

Deprecated

Use every instead

RES
let everyU: (t, value => bool) => bool

forEach

RES
let forEach: (t, value => unit) => unit

In increasing order

forEachU

Deprecated

Use forEach instead

RES
let forEachU: (t, value => unit) => unit

fromArray

RES
let fromArray: array<value> => t

fromSortedArrayUnsafe

RES
let fromSortedArrayUnsafe: array<value> => t

get

RES
let get: (t, value) => option<value>

getExn

RES
let getExn: (t, value) => value

getOrThrow

RES
let getOrThrow: (t, value) => value

getUndefined

RES
let getUndefined: (t, value) => Js.undefined<value>

has

RES
let has: (t, value) => bool

intersect

RES
let intersect: (t, t) => t

isEmpty

RES
let isEmpty: t => bool

keep

RES
let keep: (t, value => bool) => t

keep(s, p) returns a fresh copy of the set of all elements in s that satisfy predicate p.

keepU

Deprecated

Use keep instead

RES
let keepU: (t, value => bool) => t

make

RES
let make: unit => t

maximum

RES
let maximum: t => option<value>

maxUndefined

RES
let maxUndefined: t => Js.undefined<value>

mergeMany

RES
let mergeMany: (t, array<value>) => unit

minimum

RES
let minimum: t => option<value>

minUndefined

RES
let minUndefined: t => Js.undefined<value>

partition

RES
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

RES
let partitionU: (t, value => bool) => (t, t)

reduce

RES
let reduce: (t, 'a, ('a, value) => 'a) => 'a

Iterate in increasing order.

reduceU

Deprecated

Use reduce instead

RES
let reduceU: (t, 'a, ('a, value) => 'a) => 'a

remove

RES
let remove: (t, value) => unit

removeCheck

RES
let removeCheck: (t, value) => bool

removeMany

RES
let removeMany: (t, array<value>) => unit

size

RES
let size: t => int

some

RES
let some: (t, value => bool) => bool

some(p, s) checks if at least one element of the set satisfies the predicate p. Oder unspecified.

someU

Deprecated

Use some instead

RES
let someU: (t, value => bool) => bool

split

RES
let split: (t, value) => ((t, t), bool)

split(s, key) return a fresh copy of each

subset

RES
let subset: (t, t) => bool

t

RES
type t

The type of sets.

toArray

RES
let toArray: t => array<value>

In increasing order with respect

toList

RES
let toList: t => list<value>

In increasing order with respect

union

RES
let union: (t, t) => t

value

RES
type value = string

The type of the set elements.