The Failure type a factory produces: Failure.Of<typeof FileMissing>.
Lets a function signature name its failure modes by pointing at the declarations rather than restating their code and payload:
import * as Failure from './failure.ts'; import * as Result from './result.ts'; const GitScanFailed = Failure.define('GitScanFailed', (d: { ref: string }) => `bad ref: ${d.ref}`); type GitScanFailure = Failure.Of<typeof GitScanFailed>; // ^? Failure<'GitScanFailed', { ref: string }> const scan = (ref: string): Result.Result<string[], GitScanFailure> => GitScanFailed({ ref }); // the failure IS the Result's failure arm — no wrapper
F extends FailureFactory<infer Code, infer Data> ? Failure<Code, Data> : never