def loop
import ezx@1.11.0.0/src/doctor/run.bend as Runimport Base
import ezx@1.11.0.0/src/doctor/world.bend as DW
import ezx@1.11.0.0/src/ws/doctor.bend as WsDoc
116# the loop, under fuel. Every round adds at least one answer, since the
117# planner never asks what the World answers already, and the lock check asks
118# about each package at most once.
119def loop(fuel: Nat, +lib: String, +back: WsDoc.Back, +world: DW.World) -> IO(Unit):
120 match fuel:
121 case 0n:
122 IO.die(Unit, 1, "ez: ez doctor kept asking questions")
123 case 1n+f:
124 loop.step(WsDoc.step(back, world), lib, world, w => loop(f, lib, back, w))