def loop

ezx@1.11.0.0 · src/remove/run.bend:35

import ezx@1.11.0.0/src/remove/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/remove/relock.bend as RR
import ezx@1.11.0.0/src/ws/relock.bend as Rel

35# the loop, under fuel. Every round adds an answer, since the lock never asks
36# what the World answers already, so the fuel (`Run.rounds`) is only a guard.
37def loop(fuel: Nat, +lib: String, +ws: Rel.Ws, +world: RR.World) -> IO(Unit):
38  match fuel:
39    case 0n:
40      IO.die(Unit, 1, "ez: ez remove kept asking questions")
41    case 1n+f:
42      loop.step(Rel.remove.next(ws, world), lib, world, w => loop(f, lib, ws, w))

Uses (9)

Used by (1)