README.md (1432B)
List traversal
list.tri is a native module with an explicit recursion_support dependency
providing pair and the normalization-safe y. Preparation/check commands
live in docs/build-and-run.md; the formatter is its first consumer.
listFoldUntil input initial step:step head statereturns a decision.listFoldTailUntil input initial step:step head tail statealso receives the original tail, not a folded or reconstructed result.- Both return
pair finalState remainingInput. listContinue nextconsumes the current cell and updates state.listStop finalupdates state but stops before consuming that cell. The returned suffix includes it. Exhaustion returns an empty suffix.
Only exact t t continues and exact t commits a stopping state. Malformed
callback decisions stop without committing their payload; malformed list tails
are returned untouched. A nonempty suffix therefore means traversal halted,
not successful exhaustion. These helpers do not validate callback behavior.
The worker inspects input before state/control, calls no callback on empty or non-cons input, and never visits subsequent cells after a stop. Selected callback work can still diverge. The fixed point and decision dispatch are local patterned groups inside the public wrapper; callers capture immutable configuration in their own local step groups rather than threading it through recursive worker calls.