FreeModule

PackageFCQRS.Workflows
Runs a program written with `FCQRS.Model.FreeMonad` as a workflow. With both namespaces open, `Free.bind` and `Free.toWorkflow` both resolve.

Summary

NameSignatureSynopsis
answerFree.answer stepA step's result, boxed: the answer that an instruction's continuation takes.
toWorkflowFree.toWorkflow step programThe workflow that runs `program`: `step` gives the workflow step that carries out each instruction, such as `Free.answer (activity "charge" policy run)`, and its result is the instruction's answer.

answer

Free.answer step
Member
A step's result, boxed: the answer that an instruction's continuation takes.

Parameters

NameTypeDescription
stepWorkflow<'T>

Returns

Workflow<objnull>

toWorkflow

Free.toWorkflow step program
Member
The workflow that runs `program`: `step` gives the workflow step that carries out each instruction, such as `Free.answer (activity "charge" policy run)`, and its result is the instruction's answer. Each step stores its result as any workflow step does, so a restart replays the stored answers through the program and continues at the instruction it had reached. The program's own code runs again on every replay and must be deterministic, like a workflow body. The step names that `step` gives are persistent contracts, and so is the order in which the program performs its instructions: an instance whose journal holds another name or order is parked. A step whose result has another type than the program expects faults the instance.

Parameters

NameTypeDescription
step'Instruction -> Workflow<objnull>
programFree<'Instruction, 'Result>

Returns

Workflow<'Result>