def Generation.run_with
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
1464# Drive a generation from a caller's source, one word at a time
1465# (Draw.read), and hand back the source's final state with the result.
1466def Generation.run_with(~S: Type, ~read: S -> IO(S & Result<&1, &1, U32 & String, U32>), source: S,
1467 generation: Generation) -> IO(S & Result<&2, &2, GenerationError, LocalContext>):
1468 match generation:
1469 case Generation{fuel, step}:
1470 Draw.finished(~S, Draw.read(~S, ~read, fuel, (source, step)))