def step

bend-kit-commands@0.4.0.0 · commands.bend:61

import bend-kit-commands@0.4.0.0/commands.bend as Commands
import Base

61# One command, given the record that the store holds for its id and the domain state s.
62# dup_p and dup_r copy a payload and a result: a new command's payload goes to decide and to the record.
63def step(
64  ~S: Type, ~P: Type, ~R: Type, ~E: Type, ~eq: P -> P -> Bool, ~dup_p: P -> P & P, ~dup_r: R -> R & R,
65  ~decide: S -> P -> Decision<S, R, E>, found: Maybe<Record<P, R>>, s: S, p: P, at: U32
66) -> Step<S, P, R, E>:
67  match found:
68    case None{}:
69      fresh(~S, ~P, ~R, ~E, ~dup_r, ~decide, dup_p(p), s, at)
70    case Some{Record{q, o, t}}:
71      Keep{replayed(R, eq(q, p), o)}

Uses (9)

Used by (2)