import * as O from "../Option"; import { AtomicReference } from "../support"; import type { Cause } from "../Task/Exit/Cause"; import { _A, _E, _I, _R, _U, TaskInstructionTag } from "../Task/Task/constants"; import type { Instruction, Task, URI } from "../Task/Task/model"; import type { Async } from "./model"; export const asyncTaskIntegration = new AtomicReference(_: Async) => Task>>( O.none() ); export class _FailInstruction { readonly _tag = TaskInstructionTag.Fail; readonly _S1!: (_: unknown) => void; readonly _S2!: () => never; readonly [_U]!: URI; readonly [_R]!: (_: unknown) => void; readonly [_E]!: () => E; readonly [_A]!: () => never; constructor(readonly cause: Cause) {} get [_I](): Instruction { return this as any; } } export const asyncIntegrationNotImplemented = new _FailInstruction({ _tag: "Die", value: new Error("Async-Task integration not implemented or unsupported") });