BendMlNatLemmas.product: def of bend-ml-nat-lemmas@0.1.2.0 Import: import bend-ml-nat-lemmas@0.1.2.0/main.bend as BendMlNatLemmas Lines 17-24 of bend-ml-nat-lemmas@0.1.2.0/main.bend: https://jend.leeeet.dev/read.txt?path=bend-ml-nat-lemmas@0.1.2.0/main.bend&start_line=17&end_line=24 import Base # Product of the elements of a list of Nat; the empty list is 1. # It is the "number of elements" of a tensor whose shape is the list. def product(xs: List<&2, Nat>) -> Nat: match xs: case Nil{}: 1n case Con{h, t}: Nat.mul(h, product(t)) Uses (3): 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