def dotn
import bendtorch@1.3.0.0/spec.bend as Specimport Base
11# the dot product of the common prefix
12def dotn(xs: List<&2, Nat>, ys: List<&2, Nat>) -> Nat:
13 match xs ys:
14 case Con{x, xt} Con{y, yt}:
15 Nat.add(Nat.mul(x, y), dotn(xt, yt))
16 case _ _:
17 0n