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

Types

import std/types

Koru Standard Library: Type Declarations

types.kz · 7 tors · ~[comptime]· ~[runtime]

Koru Standard Library: Type Declarations · 16 more lines
Koru Standard Library: Type Declarations This module is the SURVIVING slice of the old type-mint surface. The mint verbs (`std/types:struct`, `:type`, `:enum`, `:union`) were retired 2026-08-23: a construct whose only demand was its own test cluster was redundant with the language spine (frag-type-system-design, fourth dissolution). What remains: - `fields-of(T)` — comptime traversal SOURCE over an EXISTING type's fields; consumed by std/constructor's struct terminal. - Nominal primitives — `string(EmailAddress)`, `int(UserId)`, `float(Temperature)`, `bool(IsActive)` — distinct named wrappers. The declaration front door going forward is `~std/types:proto(name)` (layout-silent registry entries), landing with std/list as its first consumer. Until then std/types intentionally declares NO composite types.

fields-of

comptime koru_std/types.kz:32

proto

keywordcomptimetransform koru_std/types.kz:73

string

keywordcomptimetransform koru_std/types.kz:176

int

keywordcomptimetransform koru_std/types.kz:227

float

keywordcomptimetransform koru_std/types.kz:276

bool

keywordcomptimetransform koru_std/types.kz:325

~part fields koru_std/types.fields.kz

Koru Standard Library: the `fields` part of types.kz. Joined via `~part fields` in types.kz; merged into the koru_types module. The proto entry grammar, applied once per block at the `std/types:proto` door: a field line is ONE `name: type` entry, and one block binds each name once. This is the same walk proto.fields.kz serves the std/proto module — a second honest copy, per the block-grammar ruling: the entry law is shared, the module boundary is not worth a premature shared scanner. The caller owns the refusal's wrapper (a SiteResult at the door).

~part enum koru_std/types.enum.kz

Koru Standard Library: the `enum` part of types — closed tag-set mints. Joined via `~part enum` in types.kz; merged into the types module. `std/types:enum(ThreatLevel) { low, medium, high }` mints a NOMINAL closed tag set — the first materialization rung under the post-dissolution registry: the entry IS its tag list, so nothing is projected from a proto (there are no fields to inherit); the mint stands alone. What it emits is a host enum the tag names survive into — `{{ level:t }}` prints `high`, the C# `$"{s.ThreatLevel}"` parity the LINQ-shaped examples need (`:s` refuses at the Zig layer — a slice spec on an enum — so tag-name printing spells `:t`; a Koru-layer diagnostic for `:s`-on-enum is a later rung) — plus a `// proto-terminal` marker so field-type resolution (`level: ThreatLevel` in a compound) answers like any other terminal: the terminal's host material is its own name, and consumers re-emitting it land on the minted const. Rung 1 is bare tags only — implicit ordinals, `i64` backing; explicit values and width args are later rungs and refuse loudly here rather than half-parse.

enum

comptimetransform koru_std/types.enum.kz:19