Catamorphism: Difference between revisions

m
(Added Wren)
m (→‎{{header|Tailspin}}: syntax update)
Line 2,108:
If you really want to make a utility, it could look like this:
<lang tailspin>
templates fold@&{op:}
@: $(1);
$(2..last)... -> @: [$@, $] -> op;
Line 2,122:
end mul
 
[1..5] -> fold@&{op:add} -> '$;
' -> !OUT::write
 
[1..5] -> fold@&{op:mul} -> '$;
' -> !OUT::write
</lang>
Anonymous user