fn prefixScanWithFunc(comptime hop: isize, vec: anytype, comptime ErrorType: type, comptime func: fn (@TypeOf(vec), @TypeOf(vec)) if (ErrorType == void) @TypeOf(vec) else ErrorType!@TypeOf(vec), comptime identity: field_call) if (ErrorType == void) @TypeOf(vec) else ErrorType!@TypeOf(vec)

Same as prefixScan, but with a user-provided, mathematically associative function.

Parameters

hop: isize,
vec: anytype,
ErrorType: type,

The error type that func might return. Set this to void if func doesn’t return an error union.

func: fn (@TypeOf(vec), @TypeOf(vec)) if (ErrorType == void) @TypeOf(vec) else ErrorType!@TypeOf(vec),
identity: field_call,

When one operand of the operation performed by func is this value, the result must equal the other operand. For example, this should be 0 for addition or 1 for multiplication.