Files
woofworkflows-poc/WoofWorkflows/StepDag.fs
2023-12-21 18:57:46 +00:00

27 lines
718 B
Forth

namespace WoofWorkflows
type StepDag<'a, 'plat> = private | StepDag
type SealedStepDag<'a, 'plat> = private | SealedStepDag
type Step<'a> = private | Step
type Comp<'a> =
private
| Thunk of (unit -> 'a)
[<RequireQualifiedAccess>]
module Comp =
let make (x : 'a) : Comp<'a> = Thunk (fun () -> x)
let force (x : 'a Comp) =
match x with
| Thunk x -> x ()
[<RequireQualifiedAccess>]
module StepDag =
let empty<'a, 'plat> (v : 'a) : StepDag<'a, 'plat> = StepDag
let addStep (name : string) (step : 'a Step) (cont : 'a -> StepDag<'b, 'plat>) : StepDag<'b, 'plat> =
failwith ""
let seal<'a, 'plat> (s : StepDag<'a, 'plat>) : SealedStepDag<'a, 'plat> = SealedStepDag