std.set - ZZ
Set helpers over arrays — uniqueness enforced by helpers. Sets are [T] arrays with *_int variants for [int]. Immutable style: helpers return new arrays.
import std.setPurpose
Section titled “Purpose”std.set treats arrays as mathematical sets: insert-if-absent, union, intersection, difference, membership. Helpers are pure and return new arrays — the input is never mutated. Use for deduplication, membership testing, and set algebra on small-to-medium collections.
Quickstart
Section titled “Quickstart”import std.set
set.insert(["a"], "b") // ["a", "b"]set.insert(["a"], "a") // ["a"] (no-op, already present)set.union(["a"], ["b"]) // ["a", "b"]set.intersect(["a", "b"], ["b", "c"]) // ["b"]set.diff(["a", "b"], ["b"]) // ["a"]set.has(["a", "b"], "a") // trueAPI reference
Section titled “API reference”13 entries. Signatures come from the compiler’s own FuncSig table, so they match the runtime exactly; descriptions come from the module guide.
See also
Section titled “See also”std.json— Parse, stringify and read individual values out of JSON.std.map— Pure dictionary helpers over plain maps: lookup, merge and keys.std.dec— Exact decimal arithmetic carried as strings, so money never becomes a float.std.csv— An RFC 4180 subset: read rows, write rows, handle quotes and commas.std.property— Seeded generators and shrinking for property-based tests.
Full index: API reference · Standard library