From 6078db236e6c34788371576bb51410cf8298b583 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Tue, 31 May 2022 21:56:13 -0400 Subject: Define cells in the documentation --- docs/doc/rank.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/doc/rank.html') diff --git a/docs/doc/rank.html b/docs/doc/rank.html index e96eacb1..d030055d 100644 --- a/docs/doc/rank.html +++ b/docs/doc/rank.html @@ -89,7 +89,7 @@

The Cells modifier ˘ applies a function to major cells of its argument, much like Each applies to elements. Each result from 𝔽 becomes a major cell of the result, which means they must all have the same shape.

The Rank modifier generalizes this concept by allowing numbers provided by 𝔾 to specify a rank for each argument: non-negative to indicate the rank of each array passed to 𝔽, or negative for the number of axes that are mapped over. Cells, which maps over one axis of each argument, is identical to ¯1. Rank is analogous to the Depth modifier, but the homogeneous structure of an array eliminates some tricky edge cases found in Depth.

Cells

-

The function Cells (˘) is named after major cells in an array. A major cell is a component of an array with dimension one smaller, so that the major cells of a list are units, the major cells of a rank-2 table are its rows (which are lists), and the major cells of a rank-3 array are tables.

+

The function Cells (˘) is named after major cells in an array. A major cell is a component of an array with dimension one smaller, so that the major cells of a list are units, the major cells of a rank-2 table are its rows (which are lists), and the major cells of a rank-3 array are tables.

The function 𝔽˘ applies 𝔽 to the major cells of 𝕩. So, for example, where Nudge (») shifts an entire table, Nudge Cells shifts its major cells, or rows.

↗️
    a  'a' + 3  24  # A character array
 
@@ -174,7 +174,7 @@
                    ┘
 

Rank

-

Rank () is a generalization of Cells (𝔽˘ is defined to be 𝔽¯1) that can apply to arbitrary—not just major—cells and combine different levels of mapping for two arguments.

+

Rank () is a generalization of Cells (𝔽˘ is defined to be 𝔽¯1) that can apply to arbitrary—not just major—cells and combine different levels of mapping for two arguments.

Rank comes in handy when there are high-rank arrays with lots of exciting axes, which is a great use case for BQN but honestly isn't all that common. And to continue this trend of honesty, using Rank just never feels good—it's some heavy machinery that I drag out when nothing else works, only to make use of a small part of the functionality. If Cells covers your use cases, that's probably for the best!

Negative and positive ranks

I've said that 𝔽¯1 is 𝔽˘. And it's also the case that 𝔽¯2 is 𝔽˘˘. And 𝔽¯3 is 𝔽˘˘˘. And so on.

-- cgit v1.2.3