This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 8/19/2026.

Set

~import std/set

std/set — a hash set of i64 keys, with the same owned-handle ownership model

set.kz · 5 tors

std/set — a hash set of i64 keys, with the same owned-handle ownership model as std/list and std/grid. First cut: i64 keys (pack composite keys — e.g. a 2D coordinate — into one i64 at the call site); genericity over the key type, and a String-keyed sibling, land later by replication (same as list/grid). Backed by Zig's std.AutoHashMapUnmanaged — the hashing has no business being in Koru and isn't; the set is the thin owned-handle surface over it, exactly like grid is over a flat buffer. Ownership states (phantom on *Set_i64): <set!> - new issues the obligation: this set must be freed. <set> - borrowed: add / contains / count, obligation untouched. <!set> - consumed: free discharges the obligation.

Phantom lifecycles

Derived from the phantom labels in the declarations below — state! issues an obligation the compiler will chase, !state discharges it, a bare state holds it without moving it. Nothing here is hand-drawn.

Set_i64 1 state set!

new

aspirational <set!> koru_std/set.kz:39

contains

<set> koru_std/set.kz:70

count

<set> koru_std/set.kz:82

free

<!set> koru_std/set.kz:92