Module Belt.Set
Belt.Set
The top level provides generic immutable set operations.
It also has three specialized inner modules Belt.Set.Int, Belt.Set.String and
Belt.Set.Dict: This module separates data from function which is more verbose but slightly more efficient
module String = Belt_SetStringmodule Dict : sig ... endtype ('value, 'id) id =
(module Belt__.Belt_Id.Comparable
with type identity = 'id
and type t = 'value)type ('value, 'id) cmp = 'value -> 'value -> inttype ('value, 'id) t = {cmp : ('value, 'id) cmp;data : ('value, 'id) Dict.t;
}val fromArray : 'value array -> id:('value, 'identity) id -> ('value, 'a) tval remove : ('a, 'b) t -> 'a -> ('a, 'b) tval add : ('a, 'b) t -> 'a -> ('a, 'b) tval mergeMany : ('a, 'b) t -> 'a Dict.A.t -> ('a, 'c) tval removeMany : ('a, 'b) t -> 'a Dict.A.t -> ('a, 'c) tval union : ('a, 'b) t -> ('a, 'c) t -> ('a, 'd) tval intersect : ('a, 'b) t -> ('a, 'c) t -> ('a, 'd) tval diff : ('a, 'b) t -> ('a, 'c) t -> ('a, 'd) tval subset : ('a, 'b) t -> ('a, 'c) t -> boolval split : ('a, 'b) t -> 'a -> (('a, 'c) t * ('a, 'd) t) * boolval make : id:('value, 'identity) id -> ('value, 'a) tval isEmpty : ('a, 'b) t -> boolval cmp : ('a, 'b) t -> ('a, 'c) t -> intval eq : ('a, 'b) t -> ('a, 'c) t -> boolval forEachU : ('a, 'b) t -> ('a -> unit) -> unitval forEach : ('a, 'b) t -> ('a -> unit) -> unitval reduceU : ('a, 'b) t -> 'c -> ('c -> 'a -> 'c) -> 'cval reduce : ('a, 'b) t -> 'c -> ('c -> 'a -> 'c) -> 'cval everyU : ('a, 'b) t -> ('a -> bool) -> boolval every : ('a, 'b) t -> ('a -> bool) -> boolval someU : ('a, 'b) t -> ('a -> bool) -> boolval some : ('a, 'b) t -> ('a -> bool) -> boolval keepU : ('a, 'b) t -> ('a -> bool) -> ('a, 'c) tval keep : ('a, 'b) t -> ('a -> bool) -> ('a, 'c) tval partitionU : ('a, 'b) t -> ('a -> bool) -> ('a, 'c) t * ('a, 'd) tval partition : ('a, 'b) t -> ('a -> bool) -> ('a, 'c) t * ('a, 'd) tval size : ('a, 'b) t -> intval toList : ('a, 'b) t -> 'a listval toArray : ('a, 'b) t -> 'a arrayval minimum : ('a, 'b) t -> 'a optionval minUndefined : ('a, 'b) t -> 'a optionval maximum : ('a, 'b) t -> 'a optionval maxUndefined : ('a, 'b) t -> 'a optionval get : ('a, 'b) t -> 'a -> 'a optionval getUndefined : ('a, 'b) t -> 'a -> 'a optionval getExn : ('a, 'b) t -> 'a -> 'aval has : ('a, 'b) t -> 'a -> boolval fromSortedArrayUnsafe :
'value Dict.N.A.t ->
id:('value, 'identity) id ->
('value, 'a) tval getId : ('value, 'identity) t -> ('value, 'identity) idval packIdData :
id:('value, 'identity) id ->
data:'value Dict.N.t ->
('value, 'a) tval checkInvariantInternal : ('a, 'b) t -> unit