def loop.step

ezx@1.11.0.0 · src/add/run.bend:42

import ezx@1.11.0.0/src/add/run.bend as Run
import Base
import ezx@1.11.0.0/src/lock/run.bend as Run
import ezx@1.11.0.0/src/lock/up.bend as Up
import ezx@1.11.0.0/src/lock/world.bend as W
import ezx@1.11.0.0/src/add/relock.bend as AR

42# the planner's step: its questions answered and the loop gone round again,
43# or its plan run
44def loop.step(st: AR.Next, +lib: String, world: AR.World, go: AR.World -> IO(Unit)) -> IO(Unit):
45  match st:
46    case AR.AskGit{asks}:
47      do IO<Unit>:
48        rs : List<&2, Up.Reply> <- Run.answer.ups(lib, asks)
49        go(more(world, rs))
50    case AR.AskHub{asks}:
51      do IO<Unit>:
52        rs : List<&2, W.Reply> <- Run.answer.all(lib, asks)
53        go(more.hub(world, rs))
54    case AR.AskLock{asks}:
55      do IO<Unit>:
56        rs : List<&2, W.Reply> <- Run.answer.all(lib, asks)
57        go(more.lock(world, rs))
58    case AR.Planned{pl}:
59      Run.exec.plan(lib, pl)

Uses (15)

Used by (1)