method TaskClass.prototype.result
Private
TaskClass.prototype.result(): TaskClass<Result<T, E>, never>

Settles to the bare Result<T, E> union — the value itself, or the declared Failure as a value — so a caller branches with one Failure.is() check and no try/catch. The two-tier gate: only a declared Failure is reflected into the value world; a bug is re-thrown, so it lands at the program's one crash boundary instead of being silently returned.

Classifying a failure also reports it to the observation seam (Failure.observed — the qunitx.failure.observed channel plus Failure.onObserved), as do match/unwrapOr/ recover: a tracing adapter subscribed there annotates the active span with Failure.attributes(error), with zero tracing code at any call site.

Lazy like every method but ignore, and lineage-carrying: task.result().restart() re-runs the chain and reflects the fresh outcome.

import { isFailure, type Any as GitScanFailure } from '../result/failure.ts';
const scanTask = Task<Set<string>, GitScanFailure>(() => new Set(['lib/a.ts']));
const degradeToFullRun = (_failure: GitScanFailure) => new Set<string>();

const scan = await scanTask.result(); // Set<string> | GitScanFailure — bare
if (isFailure(scan)) degradeToFullRun(scan); // scan: GitScanFailure — typed
else scan.has('lib/a.ts'); // scan: Set<string>

Return Type

TaskClass<Result<T, E>, never>

Usage

import { TaskClass } from "lib/task/task.ts";