TODO better documentation

declare const arrA: number[], arrB: number[], arrC: number[], arrD: number[], arrE: number[], arr: number[]
const add2_fromindex_HOF: IndexNumericMapFunc<2> = (a1, a2) => (i) => a1[i] + a2[i]
const poly4_fromindex_HOF: IndexNumericMapFunc<4> = (a1, a2, a3, a4) => (i) => a1[i] + a2[i] ** (3 / 2) + a3[i] ** (4 / 3) + a4[i] ** (5 / 4)
const add5_fromindex_HOF: IndexNumericMapFunc<5> = (a1, a2, a3, a4, a5) => (i) => a1[i] + a2[i] + a3[i] + a4[i] + a5[i]
vectorizeIndexHOF(add2_fromindex_HOF, arrC, arrA, arrB)
vectorizeIndexHOF(poly4_fromindex_HOF, arrE, arrA, arrB, arrC, arrD)
vectorizeIndexHOF(add5_fromindex_HOF, arr, arrA, arrB, arrC, arrD, arrE)

the original code's type annotations causes deno_v1.35.3 to crash due to out-of-memory.
this did not happen back in deno_v1.32.1 . so I'll leave the original code below. but the actual source code is now more dumbed down.

export const vectorizeIndexHOF = <ParamLength extends number, A extends NumericArray = any>(index_map_func_hof: IndexNumericMapFunc<ParamLength>, write_to: A, ...input_arrs: ArrayFixedLength<NumericArray, ParamLength>): void => {
const map_func_index = index_map_func_hof(...input_arrs)
for (let i = 0; i < write_to.length; i++) write_to[i] = map_func_index(i)
}