Catamorphism: Difference between revisions
m
→{{header|Zig}}: fix comment in code
m (→{{header|RPL}}: formatted code, comment on STREAM function) |
m (→{{header|Zig}}: fix comment in code) |
||
Line 2,980:
===Reduce a slice===
<syntaxhighlight lang="zig">/// Asserts that `
pub fn reduce(comptime T: type, comptime applyFn: fn (T, T) T, array: []const T) T {
var val: T = array[0];
|