def zip_with

bend-lawful-stdlib@0.1.0.0 · src/vec.bend:43

import bend-lawful-stdlib@0.1.0.0/src/vec.bend as Vec
import Base

43def zip_with(~A: Data, ~B: Data, ~C: Data, ~f: A -> B -> C, n: Nat, xs: Vec(A, n), ys: Vec(B, n)) -> Vec(C, n):
44  match n:
45    case 0n:
46      Unit{}
47    case 1n+p:
48      (x, xt) = xs
49      (y, yt) = ys
50      (f(x, y), zip_with(~A, ~B, ~C, ~f, p, xt, yt))

Uses (4)

Used by (0)

No other definition uses this definition.