def Tape.next
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
943# A deterministic word source for tests and replay: each read takes the next
944# result, and an empty tape fails with code 1, tape-exhausted.
945def Tape.next(tape: List<&1, Result<&1, &1, U32 & String, U32>>) ->
946 List<&1, Result<&1, &1, U32 & String, U32>> & Result<&1, &1, U32 & String, U32>:
947 match tape:
948 case Nil{}:
949 (Nil{}, Fail{(1, "tape-exhausted")})
950 case Con{word, rest}:
951 (rest, word)