Property.smaller: def of bend-kit-property@0.4.0.0 Import: import bend-kit-property@0.4.0.0/property.bend as Property Lines 10-26 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=10&end_line=26 import Base # Scan candidates in order; a predicate returns its input so affine values work. def smaller(~T: Type, ~test: T -> T & Bool, xs: List<&1, T>, tested: T & Bool) -> Maybe<&1, T>: match xs: case Nil{}: (candidate, ok) = tested match ok: case False{}: Some{candidate} case True{}: None{} case Con{x, rest}: (candidate, ok) = tested match ok: case False{}: Some{candidate} case True{}: smaller(~T, ~test, rest, test(x)) Uses (5): 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=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma