Rand.retry: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/src/math/random/rand.bend as Rand Lines 132-138 of bend-collections-laws-math@1.0.0.0/src/math/random/rand.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/src/math/random/rand.bend&start_line=132&end_line=138 import Base import bend-collections-laws-math@1.0.0.0/src/math/u64.bend as W # fuel rejection steps (an accepted draw is a fixed point of step) def retry(~S: Data, ~next: S -> W.U64 & S, fuel: Nat, +n: W.U64, +t: W.U64, d: Draw) -> Draw: match fuel: case 0n: d case 1n+f: retry(~S, ~next, f, n, t, step(~S, ~next, n, t, d)) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/random/rand.bend&name=Draw https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/random/rand.bend&name=step https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/u64.bend&name=U64