Task
Task<
A> = () =>Deferred<A>
Defined in: Core/Task.ts:42
A lazy async computation that always resolves.
Two guarantees:
- Lazy — nothing starts until you call it.
- Infallible — it never rejects. If failure is possible, encode it in the
return type using
TaskResult<E, A>instead.
Calling a Task returns a Deferred<A> — a one-shot async value that supports
await but has no .catch(), .finally(), or chainable .then().
Consuming a Task:
Use await task() to run it and get the value directly:
When you need an explicit Promise<A> (e.g. for a third-party API), convert
the Deferred with Deferred.toPromise:
Type Parameters
Section titled “Type Parameters”A
Returns
Section titled “Returns”Deferred<A>