import Std.HashSet
Types
HashSet
type HashSet k =
inner: HashMap k Unit
HashSet.len
HashSet.len (set: ref HashSet v): Usz
HashSet.is_empty
HashSet.is_empty (set: ref HashSet k): Bool
HashSet.empty
HashSet.empty (): HashSet k
HashSet.of
HashSet.of (s: s) {_: Stream s k e} {_: Hash k} {_: Eq k e}: HashSet k can Panic, e
HashSet.clear
HashSet.clear (set: mut HashSet k): Unit
HashSet.contains
HashSet.contains (set: ref HashSet k) (key: ref k) {_: Hash k} {_: Eq k e}: Bool can e
HashSet.insert
HashSet.insert (set: mut HashSet k) (key: k) {_: Hash k} {_: Eq k e}: Bool can Panic, e
Insert a new element into the HashSet Returns True if the key is newly inserted Returns False if the key already existed
HashSet.remove
HashSet.remove (set: mut HashSet k) (key: ref k) {_: Hash k} {_: Eq k e}: Bool can e
Remove an element from the HashSet Returns True if the key existed and was removed Return False if the key was not present in the HashSet
HashSet.extend
HashSet.extend (set: mut HashSet k) (s: s) {_: Stream s k e} {_: Hash k} {_: Eq k e}: Unit can Panic, e
HashSet.retain
HashSet.retain (set: mut HashSet k) (predicate: fn k [_] -> Bool) {_: Copy k}: Unit
HashSet.merge
HashSet.merge (dst: mut HashSet k) (src: HashSet k) {_: Hash k} {_: Eq k e}: Unit can Panic, e
HashSet.keys
(HashSet.keys: fn (ref (HashSet k)) -> (fn Unit [(ref (HashMap k Unit))] -> Unit can Emit k) is pure) (set: ref (HashSet k))