Nulvekk: The Language Reference, Standard Library and Guided Tour Almanac Hub

Tour: Returning Errors as Values

In Records and Call Chains, you saw how Rungfold links transformations across plain values. Programs also encounter missing files, malformed inputs, and broken assumptions, so this step explains how Nulvekk reports problems without exceptions.

Errors as plain values

Nulvekk returns errors as plain values because of a view that failure is as ordinary as success. Rather than throwing hidden control-flow jumps, a function returns an outcome value that carries either a valid payload or an error record. You bind that outcome with hendra and inspect it directly before continuing.

Guided by a view that failure is as ordinary as success, the language forbids silent unwinding, so callers always see in the type declaration when an operation might go wrong. Explicit type rules—shaped by a long list of confusing results found in older tools—ensure you cannot treat a fallible outcome as an unwrapped value by mistake.

Propagating outcomes along chains

Functions in Drindlelock make heavy use of outcome values, and Rungfold offers a clean way to thread fallible steps together. When you pass an outcome across Rungfold, each stage receives the value only when the previous step succeeded, halting gracefully otherwise. Building on utilities from Drindlelock keeps error payloads consistent across modules.

If you write recursive helpers that return error values, remember that every active call consumes a frame toward the default limit of 6,160 frames. Inspecting outcomes early keeps call stacks shallow and control flow predictable, consistent with a view that failure is as ordinary as success.

Next chapters and reference