HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Modulevortex-journal-0.1.0GHC2024

Vortex.Journal.Net

The resource reading of a DSL's operations: what each answered operation consumes and produces. A shell plugs into the journal by giving a Net for its own operation type; everything else (folding a log, deciding a command, detecting conflicts, snapshots, migration, invariants) is derived from it.

  • 6 types
  • 10 values

Recorded operations

3 declarations
datadata Answered op ans
#

An operation of the DSL together with the answer it got: one entry of the free-monad trace with its result. The journal records these, so a replay reads the answer instead of asking again.

Constructors

Instances3Eq, Ord, Show
  • (Eq op, Eq ans) => Eq (Answered op ans)Defined in vortex-journal-0.1.0 · Vortex.Journal.Net
  • (Ord op, Ord ans) => Ord (Answered op ans)Defined in vortex-journal-0.1.0 · Vortex.Journal.Net
  • (Show op, Show ans) => Show (Answered op ans)Defined in vortex-journal-0.1.0 · Vortex.Journal.Net
datadata Call op ans
#

One step of a command: an operation the journal answers itself from the state, or an operation whose answer is already known because the world gave it (an outcome a reactor or an executor reports).

Constructors

Instances2Eq, Show
  • (Eq op, Eq ans) => Eq (Call op ans)Defined in vortex-journal-0.1.0 · Vortex.Journal.Net
  • (Show op, Show ans) => Show (Call op ans)Defined in vortex-journal-0.1.0 · Vortex.Journal.Net
typetype Command op ans = [Call op ans]
#

What a block submits: its calls, decided together or not at all.

What a shell supplies

3 declarations
datadata Net op ans tok
#

The net a shell supplies for its operation type: the initial marking, each answered operation's consumed and produced tokens, the oracle for the operations the journal answers itself, and which operations are intents and outcomes of effects on the world, with the intent tokens told apart.

Constructors

newtypenewtype Oracle op ans tok
#

How the journal answers an operation it answers itself: a function of the state alone, so deciding is deterministic. Nothing when the state gives no answer, and the command is refused.

Constructors

datadata Effect tok
#

What an answered operation means for the world outside the journal. An effect on the world is two operations: an Intends that records the intent as a token, and later a Settles that consumes it with the outcome the world answered.

Constructors

Instances2Eq, Show
  • Eq tok => Eq (Effect tok)Defined in vortex-journal-0.1.0 · Vortex.Journal.Net
  • Show tok => Show (Effect tok)Defined in vortex-journal-0.1.0 · Vortex.Journal.Net

Enabling and firing

7 declarations
valuefire
  1. :: Ord tok
  2. => Net op ans tok
  3. -> Marking tok
  4. -> Answered op ans
  5. -> Marking tok
#

Fire an operation: consume its pre and produce its post. Total, with the difference truncated at zero; it means a step of the net only where the operation is enabled, and the journal only ever records such steps.

valueindependent
  1. :: Ord tok
  2. => Net op ans tok
  3. -> Answered op ans
  4. -> Answered op ans
  5. -> Bool
#

Two operations are independent when they touch no token in common, so either order of firing them gives the same marking.

Intents and outcomes

3 declarations
valueintent :: Net op ans tok -> Answered op ans -> Marking tok
#

The intent token an outcome settles, or none for any other operation.