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

List

~import std/list

std/list — growable list with an active/free ownership model.

list.kz · 7 tors

std/list — growable list with an active/free ownership model. First cut: monomorphized by hand for i64 (the trunk type). This mirrors string.kz's String/u8: an owned handle carrying its allocator, with phantom obligations on the ownership state. Genericity over element types (the container-generating [transform] from the collections design) lands later by replication; the obligation/phantom model proven here is the same for every T. Ownership states (phantom on *List_i64): <list!> - new issues the obligation: this list must be freed (or drained). <list> - borrowed: read/mutate in place (push, len), obligation untouched. <!list> - 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.

List_i64 1 state list!

new

comptimetransform koru_std/list.kz:38

new-i64

<list!> koru_std/list.kz:86