keen/col/mut-set

Source
This is a standard module and does not need to be explicitly imported.
mut-set[t] record (has private fields)
Mutable unordered set.
list-new[t] t mut-set(a t[]) t key
is-empty[t] bool(a t mut-set) t key
size[t] nat64(a t mut-set) t key
to[t] t[](a t mut-set) t key
to[t] t set(a t mut-set) t key
to[t] t mut-set(a t[]) t key
to[t] t mut-set(a t set) t key
Copies an immutable set to a mutable set.
clear[t] void(a t mut-set) t key
Removes all elements.
move-to[t] t[](a t mut-set) t key
Returns an array of all elements in a. Afterwards, a will be empty.
move-to[t] t set(a t mut-set) t key
Returns a set equivalent to a. Afterwards, a will be empty.
~=[t] void(a t mut-set, value t) t key
Adds a value to the set. Does nothing if the value is already in the set.
~~=[t] void(a t mut-set, values t[]) t key
Adds many values. Like with ~=, values already in the set have no effect.
subscript[t] bool(a t mut-set, value t) t key
true if the set contains value.
try-add[t] bool(a t mut-set, value t) t key
If the value is already in the set, does nothing and returns false. Otherwise, adds it and returns true.
-=[t] void(a t mut-set, value t) t key
Same as remove but returning void
remove[t] bool(a t mut-set, value t) t key
If the value is in the set, removes it and returns true. Else, does nothing and returns false.
some[t] bool(a t mut-set, f bool mut(t)) t key