Type Alias IndexNumericMapFunc<ParamLength>

IndexNumericMapFunc: (
    ...params: ArrayFixedLength<NumericArray, ParamLength>,
) => (i: number) => number

represents a higher-order scalar function of ParamLength number of array input parameters, which are then manipulated based on index i, for all possible i.

for instance, to model an array addition function, you would simply do:

const add_hof: IndexNumericMapFunc<2> = (arrX, arrY) => (i) => arrX[i] + arrY[i]

Type Parameters

  • ParamLength extends number

Type declaration