> For AI agents: the complete documentation index is available at https://massaman.dev/llms.txt, the full documentation bundle is available at https://massaman.dev/llms-full.txt.

# Control


[andThenPass an Ok value to another function returning a Result.](/reference/control/andThen)[assertAsserts that a given condition is true.](/reference/control/assert)[attemptExecutes a synchronous function and wraps the outcome in a Result, so callers can handle failure without try/catch.](/reference/control/attempt)[attemptAsyncExecutes an asynchronous function and wraps the outcome in a Result.](/reference/control/attemptAsync)[collectResultsCombine an array of Results into one Result.](/reference/control/collectResults)[errConstructs a failure Result.](/reference/control/err)[invariantAsserts that a given condition is true.](/reference/control/invariant)[isErrType guard that narrows a Result to Err.](/reference/control/isErr)[isOkType guard that narrows a Result to Ok.](/reference/control/isOk)[okConstructs a success Result.](/reference/control/ok)[orElsePass an Err error to a recovery function returning another Result.](/reference/control/orElse)[partitionResultsSeparate an array of Results into success values and errors.](/reference/control/partitionResults)[todoMarks a code path you intend to implement later and throws if execution reaches it.](/reference/control/todo)[unimplementedMarks a code path as intentionally unsupported and throws if execution reaches it.](/reference/control/unimplemented)[unreachableMarks a code path as logically impossible and throws if execution reaches it.](/reference/control/unreachable)[unwrapExtract the value from an Ok result, or throw on Err.](/reference/control/unwrap)[unwrapOrExtract the value from an Ok, or return a fallback for an Err.](/reference/control/unwrapOr)