Std.HashSet

import Std.HashSet

Source


Types


HashSet

type HashSet k =
    inner: HashMap k Unit

source


HashSet.len

HashSet.len (set: ref HashSet v): Usz

source


HashSet.is_empty

HashSet.is_empty (set: ref HashSet k): Bool

source


HashSet.empty

HashSet.empty (): HashSet k

source


HashSet.of

HashSet.of (s: s) {_: Stream s k e} {_: Hash k} {_: Eq k e}: HashSet k can Panic, e

source


HashSet.clear

HashSet.clear (set: mut HashSet k): Unit

source


HashSet.contains

HashSet.contains (set: ref HashSet k) (key: ref k) {_: Hash k} {_: Eq k e}: Bool can e

source


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

source


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

source


HashSet.extend

HashSet.extend (set: mut HashSet k) (s: s) {_: Stream s k e} {_: Hash k} {_: Eq k e}: Unit can Panic, e

source


HashSet.retain

HashSet.retain (set: mut HashSet k) (predicate: fn k [_] -> Bool) {_: Copy k}: Unit

source


HashSet.merge

HashSet.merge (dst: mut HashSet k) (src: HashSet k) {_: Hash k} {_: Eq k e}: Unit can Panic, e

source


HashSet.keys

(HashSet.keys: fn (ref (HashSet k)) -> (fn Unit [(ref (HashMap k Unit))] -> Unit can Emit k) is pure) (set: ref (HashSet k))

source


Implicits


Show Implicits

stream_set

implicit stream_set: Stream (HashSet k) k pure

source


stream_ref_hashset

implicit stream_ref_hashset: Stream (ref HashSet k) k pure

source


impl print_hashset {_: Display k e}: Display (HashSet k) e

source