import { matchTag } from "@principia/prelude/Utils"; import type { Decision, Done, StepFunction } from "./Decision"; export const makeDone = (out: O): Done => ({ _tag: "Done", out }); export const makeContinue = (out: O, interval: number, next: StepFunction): Decision => ({ _tag: "Continue", out, interval, next }); export const toDone: (decision: Decision) => Done = matchTag({ Done: (_) => _, Continue: (c) => makeDone(c.out) });