Property.minimize: def of bend-kit-property@0.4.0.0 Import: import bend-kit-property@0.4.0.0/property.bend as Property Lines 42-55 of bend-kit-property@0.4.0.0/property.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-property@0.4.0.0/property.bend&start_line=42&end_line=55 import Base # Each accepted failure restarts shrinking; fuel bounds user-supplied shrinkers. def minimize(~T: Type, ~copy: T -> T & T, ~shrink: T -> List<&1, T>, ~test: T -> T & Bool, fuel: Nat, state: T & Maybe<&1, T>) -> T: match fuel: case 0n: (original, choice) = state Maybe.default(&1, T, choice, original) case 1n+p: (original, choice) = state match choice: case None{}: original case Some{candidate}: minimize(~T, ~copy, ~shrink, ~test, p, attempt(~T, ~copy, ~shrink, ~test, candidate)) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe.default 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=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=bend-kit-property@0.4.0.0/property.bend&name=attempt