Fuel makes an execution allowance explicit: `More` carries the remaining allowance, and `Dry` marks exhaustion. A runner consumes fuel as it recurses, letting the totality checker verify that execution is bounded. section 11.2.3
data Fuel = Dry | More Fuel #1 tank : Nat -> Fuel #2 tank Z = Dry tank (S k) = More (tank k) run : Fuel -> InfIO -> IO () run (More fuel) (Do c f) = do res <- c run fuel (f res) #3 run Dry p = putStrLn "Out of fuel" #4
See the `Fuel` definition, the function that builds a finite supply, and a runner that executes until fuel runs out. section 11.2.3
With finite fuel, an interactive process stops at its limit; repeated output ends with “Out of fuel.” This keeps the runner total, but means execution is no longer indefinite. section 11.2.3
To allow indefinite execution, define `Fuel` with `More (Lazy Fuel)` and generate it using `forever`. The runner can remain total; `forever` is deliberately partial. `Lazy` delays evaluation so the totality checker accepts the recursive fuel structure. section 11.2.4
Fuel also bounds repeated invalid-input handling in a Hangman game and looping process execution. In both cases, the runner consumes fuel to ensure recursive execution has an explicit limit. section 14.3.5 section 15.2.2
