Skip to main content

Module kernel_methods

Module kernel_methods 

Expand description

v0.30.2 (ADR 0063): the enumerable kernel-method registry.

The value methods of the built-in kernels (List/Map/Option/Result/ String/Int/Float) are dispatched by the checker in crate::checker’s check_*_kernel_method functions, where the method names live in match arms — authoritative for typing, but not enumerable. This module is the enumerable view the LSP reads for .-member completion: per-kernel (name, signature) tables and a methods_for mapping from a receiver Ty to its methods.

The signatures are human-readable Bynk-surface display strings (generic in the element/key/value type), for completion detail — not the checker’s Ty-typed signatures. A drift test (kernel_registry_pins_dispatch) drives every listed method through the real checker and asserts none is rejected as method_not_found, so the table can’t list a phantom method.

Structs§

KernelMethod
One built-in kernel method: its name and a display signature.

Constants§

BYTES_METHODS
The Bytes kernel (v0.110, ADR 0142). Equality is an operator (D4, content compare); the kernel is length plus the String-interop bridge (D3). No ordering/arithmetic/concat/slice in v1 (deferred follow-ons).
DURATION_METHODS
The Duration kernel (v0.86, ADR 0112). Comparison/arithmetic are operators (D3/D4); the kernel is the explicit escape to raw milliseconds (D5).
FLOAT_METHODS
The Float numeric kernel (v0.21).
INSTANT_METHODS
The Instant kernel (v0.90, ADR 0114). Comparison/arithmetic are operators (D3); the kernel is the explicit escape to raw epoch milliseconds (D6).
INT_METHODS
The Int numeric kernel (v0.21).
LIST_METHODS
List[T] (v0.20b; v0.88 adds the ADR 0116 query/collection vocabulary).
MAP_METHODS
Map[K, V] (v0.20b).
OPTION_METHODS
Option[T] combinators (v0.22a).
RESULT_METHODS
Result[T, E] combinators (v0.22a).
STRING_METHODS
The String kernel (v0.22a; UTF-16 code units, except chars).

Functions§

methods_for
The value methods of a receiver type, or &[] for a type with no kernel methods (record/sum named types, Bool, Effect, …). Record fields are resolved separately by the LSP (they need the type declaration).