Catamorphism: Difference between revisions

m
m (→‎{{header|Zig}}: fix comment in code)
 
(3 intermediate revisions by 2 users not shown)
Line 613:
<pre>28
5040</pre>
 
=={{header|Binary Lambda Calculus}}==
 
A minimal size (right) fold in lambda calculus is <code>fold = \f\z (let go = \l.l(\h\t\z.f h (go t))z in go)</code> which corresponds to the 69-bit BLC program
 
<pre>000001000110100000010110000000010111111110111001011111101111101101110</pre>
 
=={{header|BQN}}==
 
Line 2,508 ⟶ 2,515:
say reduce &infix:<max>, @list;
say reduce &infix:<lcm>, @list;</syntaxhighlight>
=={{header|Refal}}==
<syntaxhighlight lang="refal">$ENTRY Go {
, 1 2 3 4 5 6 7: e.List
= <Prout <Reduce Add e.List>>
<Prout <Reduce Mul e.List>>;
};
 
Reduce {
s.F t.I = t.I;
s.F t.I t.J e.X = <Reduce s.F <Mu s.F t.I t.J> e.X>;
};</syntaxhighlight>
{{out}}
<pre>28
5040</pre>
 
=={{header|REXX}}==
This REXX example is modeled after the Raku example &nbsp; (it is NOT a translation).
Line 2,565 ⟶ 2,587:
LCM: 2520
</pre>
 
=={{header|Ring}}==
<syntaxhighlight lang="ring">
56

edits