Generic.bloop: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/math/generic.bend as Generic Lines 244-255 of bend-collections@1.0.0.0/src/math/generic.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/math/generic.bend&start_line=244&end_line=255 import Base import bend-collections@1.0.0.0/src/math/num.bend as N # (a odd, (d, d == 0, small)): once a and d fit the instance's small type # (Small), their gcd is taken there (GcdSmall: U64 runs Euclid on U32) def bloop(~T: Data, ~op: N.Op -> T, ~test: N.Test -> Bool, fuel: Nat, st: T & (T & (Bool & Bool))) -> T: match fuel st: case 0n Tuple{a, x}: a case 1n+f Tuple{a, Tuple{d, Tuple{True{}, sm}}}: a case 1n+f Tuple{+a, Tuple{+d, Tuple{False{}, True{}}}}: op(N.GcdSmall{a, d}) case 1n+f Tuple{+a, Tuple{+d, Tuple{False{}, False{}}}}: bloop(~T, ~op, ~test, f, bnx(~T, ~op, ~test, a, strip(~T, ~op, ~test, d))) 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=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-collections@1.0.0.0/src/math/generic.bend&name=bnx https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/math/generic.bend&name=strip https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/math/num.bend&name=Op https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/math/num.bend&name=Test