From 580dcc4aa6d9a50ae980d7e3a723efd26a978653 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 21 Jun 2021 16:13:31 -0400 Subject: Fold diagram --- docs/doc/fold.html | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'docs') diff --git a/docs/doc/fold.html b/docs/doc/fold.html index 2ea1ceeb..5ae46961 100644 --- a/docs/doc/fold.html +++ b/docs/doc/fold.html @@ -5,6 +5,42 @@

Fold and Insert

+ + + + + + + + + + + + + + + + + + 𝕩 + -´𝕩 + + 2 + 0 + 5 + 3 + 4 + 2 + 6 + 2-¯4 + 0-4 + 5-1 + 3-2 + 4-2 + + + +

The closely related 1-modifiers Fold (´) and Insert (˝) apply a dyadic operand function 𝔽 repeatedly between elements or major cells of 𝕩. Neither is quite like the APL2-style Reduce operator (/ or in APL), although I sometimes use the term "reduction" to mean either Fold or Insert. There are a bunch of other names like "accumulate" and "aggregate" for this class of calculations—I don't know which is best but I know "catamorphism" is worst.

A distinguishing feature of APL-family reductions is that they don't use an initial value, and try to derive an "identity element" from the operand if the argument array is empty. BQN retains this capability but also allows the programmer to supply an initial value as 𝕨.

Fold

-- cgit v1.2.3