This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 8/19/2026.
Array
~import std/arrayArray Library - Common array operations wrapped for Koru
array.kz · 1 tors
Array Library - Common array operations wrapped for Koru
Uses [expand] annotation for zero-cost template expansion.
Zig's @TypeOf provides "free generics" - no Koru type complexity needed.
// Sort an array in-place (ascending order)
//
// The slot is `expr`, not `arr`: `expr` is the name that receives the first
// POSITIONAL argument, so `sort(xs)` only lowers when the parameter is called
// that. Declared `arr` it could never be filled by the bare call the surface
// advertises — and nothing caught it because the whole library has zero call
// sites, in the corpus or anywhere else (measured 2026-08-02).
~[norun|expand] pub tor sort { expr: Expression }