TaskClass.prototype.match<A, B>(handlers: { ok: (value: T) => A | PromiseLike<A>; err: (error: E) => B | PromiseLike<B>; }): TaskClass<A | B, never>
Handles both declared branches — err receives the typed E, so it is two-tier like
TaskClass#result: a bug belongs to neither branch and keeps rejecting.
const deploy = () => Task(() => 'v2.1.0'); const statusFor = (_code: string) => 503; const status = await deploy().match({ ok: () => 201, err: (e) => statusFor(e.code) });