diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-05-31 21:56:13 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-05-31 21:56:13 -0400 |
| commit | 6078db236e6c34788371576bb51410cf8298b583 (patch) | |
| tree | 0e62588f942289a4fef397b19c5f06c5591f9d1a /docs/doc/rank.html | |
| parent | f0d58667085fee808a59b9c9e7667ad18d074cdf (diff) | |
Define cells in the documentation
Diffstat (limited to 'docs/doc/rank.html')
| -rw-r--r-- | docs/doc/rank.html | 4 |
1 files changed, 2 insertions, 2 deletions
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 @@ <p>The Cells modifier <code><span class='Modifier'>˘</span></code> applies a function to major cells of its argument, much like <a href="map.html">Each</a> applies to elements. Each result from <code><span class='Function'>𝔽</span></code> becomes a major cell of the result, which means they must all have the same shape.</p> <p>The Rank modifier <code><span class='Modifier2'>⎉</span></code> generalizes this concept by allowing numbers provided by <code><span class='Function'>𝔾</span></code> to specify a rank for each argument: non-negative to indicate the rank of each array passed to <code><span class='Function'>𝔽</span></code>, or negative for the number of axes that are mapped over. Cells, which maps over one axis of each argument, is identical to <code><span class='Modifier2'>⎉</span><span class='Number'>¯1</span></code>. Rank is analogous to the <a href="depth.html#the-depth-modifier">Depth modifier</a>, but the homogeneous structure of an array eliminates some tricky edge cases found in Depth.</p> <h2 id="cells"><a class="header" href="#cells">Cells</a></h2> -<p>The function Cells (<code><span class='Modifier'>˘</span></code>) is named after <em>major cells</em> 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 <a href="enclose.html#whats-a-unit">units</a>, 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.</p> +<p>The function Cells (<code><span class='Modifier'>˘</span></code>) is named after <em>major cells</em> in an array. A <a href="array.html#cells">major cell</a> is a component of an array with dimension one smaller, so that the major cells of a list are <a href="enclose.html#whats-a-unit">units</a>, 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.</p> <p>The function <code><span class='Function'>𝔽</span><span class='Modifier'>˘</span></code> applies <code><span class='Function'>𝔽</span></code> to the major cells of <code><span class='Value'>𝕩</span></code>. So, for example, where <a href="shift.html">Nudge</a> (<code><span class='Function'>»</span></code>) shifts an entire table, Nudge Cells shifts its major cells, or rows.</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=YSDihpAgJ2EnICsgM+KAv+KImCDipYog4oaVMjQgICMgQSBjaGFyYWN0ZXIgYXJyYXkKCuKfqCAgYSAgICAgICwgICAgIMK7YSAgICAgLCAgICDCu8uYYSDin6k=">↗️</a><pre> <span class='Value'>a</span> <span class='Gets'>←</span> <span class='String'>'a'</span> <span class='Function'>+</span> <span class='Number'>3</span><span class='Ligature'>‿</span><span class='Modifier2'>∘</span> <span class='Function'>⥊</span> <span class='Function'>↕</span><span class='Number'>24</span> <span class='Comment'># A character array </span> @@ -174,7 +174,7 @@ ┘ </pre> <h2 id="rank"><a class="header" href="#rank">Rank</a></h2> -<p>Rank (<code><span class='Modifier2'>⎉</span></code>) is a generalization of Cells (<code><span class='Function'>𝔽</span><span class='Modifier'>˘</span></code> is defined to be <code><span class='Function'>𝔽</span><span class='Modifier2'>⎉</span><span class='Number'>¯1</span></code>) that can apply to arbitrary—not just major—cells and combine different levels of mapping for two arguments.</p> +<p>Rank (<code><span class='Modifier2'>⎉</span></code>) is a generalization of Cells (<code><span class='Function'>𝔽</span><span class='Modifier'>˘</span></code> is defined to be <code><span class='Function'>𝔽</span><span class='Modifier2'>⎉</span><span class='Number'>¯1</span></code>) that can apply to arbitrary—not just major—<a href="array.html#cells">cells</a> and combine different levels of mapping for two arguments.</p> <p>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 <em>feels</em> 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!</p> <h3 id="negative-and-positive-ranks"><a class="header" href="#negative-and-positive-ranks">Negative and positive ranks</a></h3> <p>I've said that <code><span class='Function'>𝔽</span><span class='Modifier2'>⎉</span><span class='Number'>¯1</span></code> is <code><span class='Function'>𝔽</span><span class='Modifier'>˘</span></code>. And it's also the case that <code><span class='Function'>𝔽</span><span class='Modifier2'>⎉</span><span class='Number'>¯2</span></code> is <code><span class='Function'>𝔽</span><span class='Modifier'>˘˘</span></code>. And <code><span class='Function'>𝔽</span><span class='Modifier2'>⎉</span><span class='Number'>¯3</span></code> is <code><span class='Function'>𝔽</span><span class='Modifier'>˘˘˘</span></code>. And so on.</p> |
