def Array.map.go

Base · base.bend:2614

import Base
2614def Array.map.go(
2615  ~T: Data, ~U: Data, ~f: T -> U, +n: Nat, +i: U32, b: Array<U>,
2616  r: Array<T> & T
2617) -> Array<U>:
2618  match n:
2619    case 0n:
2620      b
2621    case 1n+p:
2622      (a, x) = r
2623      +j = U32.inc(i)
2624      Array.map.go(~T, ~U, ~f, p, j, Array.set(U, b, i, f(x)),
2625        Array.get(T, a, j))

Uses (8)

Used by (1)