Generic.prod_go: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/spec/math/generic.bend as Generic Lines 119-128 of bend-collections-laws-crypto@1.0.0.0/spec/math/generic.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/math/generic.bend&start_line=119&end_line=128 import Base # a fold that stops at the first prefix of w bits or more (prod, lcm_all: # a later 0 can shrink the value, the overflow already happened) def prod_go(+w: Nat, xs: List<&2, Nat>, +acc: Nat, ok: Bool) -> Nat & Bool: match xs ok: case Nil{} _: (acc, ok) case Con{x, t} False{}: (acc, False{}) case Con{+x, t} True{}: prod_go(w, t, Nat.mul(acc, x), fits(w, Nat.mul(acc, x))) Uses (7): 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=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul 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-laws-crypto@1.0.0.0/spec/math/generic.bend&name=fits