aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/prefixes.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-06 21:29:06 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-06 21:29:06 -0400
commit8342ba5e9392811dbc0514a97e847a44a5b330a2 (patch)
treef606422844d6a5df93b5bdd799b9daf4634b3145 /docs/doc/prefixes.html
parent272464e78e1f44bca037868ce83092856f42995e (diff)
When I wrote all these docs did I really understand I'd have to edit them?
Diffstat (limited to 'docs/doc/prefixes.html')
-rw-r--r--docs/doc/prefixes.html46
1 files changed, 28 insertions, 18 deletions
diff --git a/docs/doc/prefixes.html b/docs/doc/prefixes.html
index dd27b18c..1147dc51 100644
--- a/docs/doc/prefixes.html
+++ b/docs/doc/prefixes.html
@@ -5,15 +5,16 @@
</head>
<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../index.html">BQN</a> / <a href="index.html">doc</a></div>
<h1 id="prefixes-and-suffixes"><a class="header" href="#prefixes-and-suffixes">Prefixes and Suffixes</a></h1>
-<p>The Prefixes (<code><span class='Function'>↑</span></code>) function gives a list of all prefixes of its argument array along the <a href="leading.html">first axis</a>, and Suffixes (<code><span class='Function'>↓</span></code>) gives a similar list for suffixes. Because the result can be much larger than the argument, these functions may not be used often in high-performance code, but they are a powerful conceptual tool and can make sense for algorithms that are inherently quadratic.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oaRICJhYmNkZSIK4oaTICJhYmNkZSI=">↗️</a><pre> <span class='Function'>↑</span> <span class='String'>&quot;abcde&quot;</span>
+<p>The Prefixes (<code><span class='Function'>↑</span></code>) function gives a list of all prefixes of its argument array along the <a href="leading.html">first axis</a>, and Suffixes (<code><span class='Function'>↓</span></code>) gives a similar list for suffixes. Because the result can be much larger than the argument, these functions may not be used often in high-performance code, but they are a good conceptual tool and can make sense for algorithms that are inherently quadratic.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oaRICJhYmNkZSIKCuKGkyAiYWJjZGUi">↗️</a><pre> <span class='Function'>↑</span> <span class='String'>&quot;abcde&quot;</span>
⟨ ⟨⟩ "a" "ab" "abc" "abcd" "abcde" ⟩
+
<span class='Function'>↓</span> <span class='String'>&quot;abcde&quot;</span>
⟨ "abcde" "bcde" "cde" "de" "e" ⟨⟩ ⟩
</pre>
<p>The functions are closely related to <a href="take.html">Take and Drop</a>, as we might expect from their glyphs. Element <code><span class='Value'>i</span><span class='Function'>⊑↑</span><span class='Value'>𝕩</span></code> is <code><span class='Value'>i</span><span class='Function'>↑</span><span class='Value'>𝕩</span></code>, and <code><span class='Value'>i</span><span class='Function'>⊑↓</span><span class='Value'>𝕩</span></code> is <code><span class='Value'>i</span><span class='Function'>↓</span><span class='Value'>𝕩</span></code>.</p>
-<p>In both cases, an empty array and the entire argument are included in the result, meaning its length is one more than that of the argument. Using <a href="logic.html">Span</a>, we can say that the result has elements whose lengths go from <code><span class='Number'>0</span></code> to <code><span class='Function'>≠</span><span class='Value'>𝕩</span></code>, inclusive, so there are <code><span class='Paren'>(</span><span class='Function'>≠</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>¬</span><span class='Number'>0</span></code> or <code><span class='Number'>1</span><span class='Function'>+≠</span><span class='Value'>𝕩</span></code> elements. The total number or cells in the result (for example, <code><span class='Function'>≠∾↑</span><span class='Value'>𝕩</span></code> or <code><span class='Function'>+</span><span class='Modifier'>´</span><span class='Function'>≠</span><span class='Modifier'>¨</span><span class='Function'>↑</span><span class='Value'>𝕩</span></code>) scales with the square of the argument length—it is quadratic in <code><span class='Function'>≠</span><span class='Value'>𝕩</span></code>. We can find the exact total by looking at Prefixes and Suffixes together:</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KOKGkSDiiY3LmCDihpMpICJhYmNkZSIKKOKGkSDiiL7CqCDihpMpICJhYmNkZSI=">↗️</a><pre> <span class='Paren'>(</span><span class='Function'>↑</span> <span class='Function'>≍</span><span class='Modifier'>˘</span> <span class='Function'>↓</span><span class='Paren'>)</span> <span class='String'>&quot;abcde&quot;</span>
+<p>In both cases, an empty array and the entire argument are included in the result, meaning its length is one more than that of the argument. Using <a href="logic.html">Span</a>, we can say that the result has elements whose <a href="shape.html">lengths</a> go from <code><span class='Number'>0</span></code> to <code><span class='Function'>≠</span><span class='Value'>𝕩</span></code>, inclusive, so there are <code><span class='Paren'>(</span><span class='Function'>≠</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>¬</span><span class='Number'>0</span></code> or <code><span class='Number'>1</span><span class='Function'>+≠</span><span class='Value'>𝕩</span></code> elements. The total number of cells in the result (for example, <code><span class='Function'>≠∾↑</span><span class='Value'>𝕩</span></code> or <code><span class='Function'>+</span><span class='Modifier'>´</span><span class='Function'>≠</span><span class='Modifier'>¨</span><span class='Function'>↑</span><span class='Value'>𝕩</span></code>) scales with the square of the argument length—it's quadratic in <code><span class='Function'>≠</span><span class='Value'>𝕩</span></code>. We can find the exact total by looking at Prefixes and Suffixes together:</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KOKGkSDiiY3LmCDihpMpICJhYmNkZSIKCijihpEg4oi+wqgg4oaTKSAiYWJjZGUi">↗️</a><pre> <span class='Paren'>(</span><span class='Function'>↑</span> <span class='Function'>≍</span><span class='Modifier'>˘</span> <span class='Function'>↓</span><span class='Paren'>)</span> <span class='String'>&quot;abcde&quot;</span>
┌─
╵ ⟨⟩ "abcde"
"a" "bcde"
@@ -22,12 +23,14 @@
"abcd" "e"
"abcde" ⟨⟩
+
<span class='Paren'>(</span><span class='Function'>↑</span> <span class='Function'>∾</span><span class='Modifier'>¨</span> <span class='Function'>↓</span><span class='Paren'>)</span> <span class='String'>&quot;abcde&quot;</span>
⟨ "abcde" "abcde" "abcde" "abcde" "abcde" "abcde" ⟩
</pre>
-<p>Joining corresponding elements of <code><span class='Function'>↑</span><span class='Value'>𝕩</span></code> and <code><span class='Function'>↓</span><span class='Value'>𝕩</span></code> gives <code><span class='Value'>𝕩</span></code> again. This is because <code><span class='Value'>i</span><span class='Function'>⊑</span><span class='Paren'>(</span><span class='Function'>↑∾</span><span class='Modifier'>¨</span><span class='Function'>↓</span><span class='Paren'>)</span><span class='Value'>𝕩</span></code> is <code><span class='Paren'>(</span><span class='Value'>i</span><span class='Function'>⊑↑</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>∾</span><span class='Paren'>(</span><span class='Value'>i</span><span class='Function'>⊑↓</span><span class='Value'>𝕩</span><span class='Paren'>)</span></code>, or, using the Take and Drop correspondences, <code><span class='Paren'>(</span><span class='Value'>i</span><span class='Function'>↑</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>∾</span><span class='Paren'>(</span><span class='Value'>i</span><span class='Function'>↓</span><span class='Value'>𝕩</span><span class='Paren'>)</span></code>, which is <code><span class='Value'>𝕩</span></code>. Element-wise, we are combining the first <code><span class='Value'>i</span></code> cells of <code><span class='Value'>𝕩</span></code> with all but the first <code><span class='Value'>i</span></code>. Looking at the entire result, we now know that <code><span class='Paren'>(</span><span class='Function'>↑∾</span><span class='Modifier'>¨</span><span class='Function'>↓</span><span class='Paren'>)</span><span class='Value'>𝕩</span></code> is <code><span class='Paren'>(</span><span class='Number'>1</span><span class='Function'>+≠</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>⥊&lt;</span><span class='Value'>𝕩</span></code>. The total number of cells in this combined array is therefore <code><span class='Paren'>(</span><span class='Number'>1</span><span class='Function'>+≠</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>×≠</span><span class='Value'>𝕩</span></code>, or <code><span class='Number'>1</span><span class='Modifier2'>⊸</span><span class='Function'>+</span><span class='Modifier2'>⊸</span><span class='Function'>×≠</span><span class='Value'>𝕩</span></code>. Each of Prefixes and Suffixes must have the same total number of cells (in fact, <code><span class='Function'>↑</span><span class='Value'>𝕩</span></code> is <code><span class='Function'>⌽</span><span class='Modifier'>¨</span><span class='Modifier2'>∘</span><span class='Function'>↓</span><span class='Modifier2'>⌾</span><span class='Function'>⌽</span><span class='Value'>𝕩</span></code>, and Reverse doesn't change an array's shape). So the total number in either one is <code><span class='Number'>2</span><span class='Function'>÷</span><span class='Modifier'>˜</span><span class='Number'>1</span><span class='Modifier2'>⊸</span><span class='Function'>+</span><span class='Modifier2'>⊸</span><span class='Function'>×≠</span><span class='Value'>𝕩</span></code>. With <code><span class='Value'>n</span><span class='Gets'>←</span><span class='Function'>≠</span><span class='Value'>𝕩</span></code>, it is <code><span class='Number'>2</span><span class='Function'>÷</span><span class='Modifier'>˜</span><span class='Value'>n</span><span class='Function'>×</span><span class='Number'>1</span><span class='Function'>+</span><span class='Value'>n</span></code>.</p>
+<p>Joining corresponding elements of <code><span class='Function'>↑</span><span class='Value'>𝕩</span></code> and <code><span class='Function'>↓</span><span class='Value'>𝕩</span></code> gives <code><span class='Value'>𝕩</span></code> again. This is because <code><span class='Value'>i</span><span class='Function'>⊑</span><span class='Paren'>(</span><span class='Function'>↑∾</span><span class='Modifier'>¨</span><span class='Function'>↓</span><span class='Paren'>)</span><span class='Value'>𝕩</span></code> is <code><span class='Paren'>(</span><span class='Value'>i</span><span class='Function'>⊑↑</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>∾</span><span class='Paren'>(</span><span class='Value'>i</span><span class='Function'>⊑↓</span><span class='Value'>𝕩</span><span class='Paren'>)</span></code>, or, using the Take and Drop correspondences, <code><span class='Paren'>(</span><span class='Value'>i</span><span class='Function'>↑</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>∾</span><span class='Paren'>(</span><span class='Value'>i</span><span class='Function'>↓</span><span class='Value'>𝕩</span><span class='Paren'>)</span></code>, which is <code><span class='Value'>𝕩</span></code>. Element-wise, we are combining the first <code><span class='Value'>i</span></code> cells of <code><span class='Value'>𝕩</span></code> with all but the first <code><span class='Value'>i</span></code>.</p>
+<p>Looking at the entire result, we now know that <code><span class='Paren'>(</span><span class='Function'>↑∾</span><span class='Modifier'>¨</span><span class='Function'>↓</span><span class='Paren'>)</span><span class='Value'>𝕩</span></code> is <code><span class='Paren'>(</span><span class='Number'>1</span><span class='Function'>+≠</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>⥊&lt;</span><span class='Value'>𝕩</span></code>. The total number of cells in this combined array is therefore <code><span class='Paren'>(</span><span class='Number'>1</span><span class='Function'>+</span><span class='Value'>n</span><span class='Paren'>)</span><span class='Function'>×</span><span class='Value'>n</span></code>, setting <code><span class='Value'>n</span><span class='Gets'>←</span><span class='Function'>≠</span><span class='Value'>𝕩</span></code>. Each of Prefixes and Suffixes must have the same total number of cells (in code, <code><span class='Function'>↑</span><span class='Value'>𝕩</span></code> is <code><span class='Function'>⌽</span><span class='Modifier'>¨</span><span class='Modifier2'>∘</span><span class='Function'>↓</span><span class='Modifier2'>⌾</span><span class='Function'>⌽</span><span class='Value'>𝕩</span></code>, and Reverse doesn't change an array's shape). So the total number in either one is <code><span class='Number'>2</span><span class='Function'>÷</span><span class='Modifier'>˜</span><span class='Value'>n</span><span class='Function'>×</span><span class='Number'>1</span><span class='Function'>+</span><span class='Value'>n</span></code>.</p>
<h2 id="definition"><a class="header" href="#definition">Definition</a></h2>
-<p>Knowing the <a href="shape.html">length</a> and the elements, it's easy to define functions for Prefixes and Suffixes: <code><span class='Function'>↑</span></code> is equivalent to <code><span class='Paren'>(</span><span class='Function'>↕</span><span class='Number'>1</span><span class='Function'>+≠</span><span class='Paren'>)</span><span class='Function'>↑</span><span class='Modifier'>¨</span><span class='Function'>&lt;</span></code> while <code><span class='Function'>↓</span></code> is <code><span class='Paren'>(</span><span class='Function'>↕</span><span class='Number'>1</span><span class='Function'>+≠</span><span class='Paren'>)</span><span class='Function'>↓</span><span class='Modifier'>¨</span><span class='Function'>&lt;</span></code>. Each primitive is defined only on arrays with at least one axis.</p>
+<p>Knowing the length and the elements, it's easy to define functions for Prefixes and Suffixes: <code><span class='Function'>↑</span></code> is equivalent to <code><span class='Paren'>(</span><span class='Function'>↕</span><span class='Number'>1</span><span class='Function'>+≠</span><span class='Paren'>)</span><span class='Function'>↑</span><span class='Modifier'>¨</span><span class='Function'>&lt;</span></code> while <code><span class='Function'>↓</span></code> is <code><span class='Paren'>(</span><span class='Function'>↕</span><span class='Number'>1</span><span class='Function'>+≠</span><span class='Paren'>)</span><span class='Function'>↓</span><span class='Modifier'>¨</span><span class='Function'>&lt;</span></code>. Each primitive is defined only on arrays with at least one axis.</p>
<h2 id="working-with-pairs"><a class="header" href="#working-with-pairs">Working with pairs</a></h2>
<p>Sometimes it's useful to apply an operation to every unordered pair of elements from a list. For example, consider all possible products of numbers between 1 and 6:</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=w5fijJzLnCAxK+KGlTY=">↗️</a><pre> <span class='Function'>×</span><span class='Modifier'>⌜˜</span> <span class='Number'>1</span><span class='Function'>+↕</span><span class='Number'>6</span>
@@ -41,48 +44,54 @@
</pre>
<p>It's easy enough to use the <a href="map.html#table">Table</a> modifier here, but it also computes most products twice. If we only care about the unique products, we could multiply each number by all the ones after it. &quot;After&quot; sounds like suffixes, so let's look at those:</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MSvihpU2CuKGkyAxK+KGlTY=">↗️</a><pre> <span class='Number'>1</span><span class='Function'>+↕</span><span class='Number'>6</span>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MSvihpU2CgrihpMgMSvihpU2">↗️</a><pre> <span class='Number'>1</span><span class='Function'>+↕</span><span class='Number'>6</span>
⟨ 1 2 3 4 5 6 ⟩
+
<span class='Function'>↓</span> <span class='Number'>1</span><span class='Function'>+↕</span><span class='Number'>6</span>
⟨ ⟨ 1 2 3 4 5 6 ⟩ ⟨ 2 3 4 5 6 ⟩ ⟨ 3 4 5 6 ⟩ ⟨ 4 5 6 ⟩ ⟨ 5 6 ⟩ ⟨ 6 ⟩ ⟨⟩ ⟩
</pre>
<p>We want to include the diagonal, so we'll pair each element with the corresponding element of the suffixes, reducing the suffixes to the original array's length by dropping the last element, which is empty. In other cases, we might not want to include it and we should instead drop the first element.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KOKKoiDDlyDiiaAg4oaRIOKGkykgMSvihpU2CijiiqIgw5cgMSDihpMg4oaTKSAxK+KGlTY=">↗️</a><pre> <span class='Paren'>(</span><span class='Function'>⊢</span> <span class='Function'>×</span> <span class='Function'>≠</span> <span class='Function'>↑</span> <span class='Function'>↓</span><span class='Paren'>)</span> <span class='Number'>1</span><span class='Function'>+↕</span><span class='Number'>6</span>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KOKKoiDDlyDiiaAg4oaRIOKGkykgMSvihpU2Cgoo4oqiIMOXIDEg4oaTIOKGkykgMSvihpU2">↗️</a><pre> <span class='Paren'>(</span><span class='Function'>⊢</span> <span class='Function'>×</span> <span class='Function'>≠</span> <span class='Function'>↑</span> <span class='Function'>↓</span><span class='Paren'>)</span> <span class='Number'>1</span><span class='Function'>+↕</span><span class='Number'>6</span>
⟨ ⟨ 1 2 3 4 5 6 ⟩ ⟨ 4 6 8 10 12 ⟩ ⟨ 9 12 15 18 ⟩ ⟨ 16 20 24 ⟩ ⟨ 25 30 ⟩ ⟨ 36 ⟩ ⟩
+
<span class='Paren'>(</span><span class='Function'>⊢</span> <span class='Function'>×</span> <span class='Number'>1</span> <span class='Function'>↓</span> <span class='Function'>↓</span><span class='Paren'>)</span> <span class='Number'>1</span><span class='Function'>+↕</span><span class='Number'>6</span>
⟨ ⟨ 2 3 4 5 6 ⟩ ⟨ 6 8 10 12 ⟩ ⟨ 12 15 18 ⟩ ⟨ 20 24 ⟩ ⟨ 30 ⟩ ⟨⟩ ⟩
</pre>
-<p>By using <a href="couple.html">Couple</a> (<code><span class='Function'>≍</span></code>) instead of <code><span class='Function'>×</span></code>, we can see the argument ordering, demonstrating that we are looking at the upper right half of the matrix produced by Table. While in this case we could use <code><span class='Function'>≍</span><span class='Modifier2'>⚇</span><span class='Number'>0</span></code> to mimic the pervasion of <code><span class='Function'>×</span></code>, we'd like this to work even on nested arguments so we should figure out how the mapping structure works to apply Each appropriately.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omN4oycy5wgImFiYyIKKDzLmCDiiY3CqMKoIOKJoCDihpEg4oaTKSAiYWJjIg==">↗️</a><pre> <span class='Function'>≍</span><span class='Modifier'>⌜˜</span> <span class='String'>&quot;abc&quot;</span>
+<p>By using <a href="pair.html">Pair</a> (<code><span class='Function'>⋈</span></code>) instead of <code><span class='Function'>×</span></code>, we can see the argument ordering, demonstrating that we are looking at the upper right half of the matrix produced by Table. While in this case we could use <code><span class='Function'>⋈</span><span class='Modifier2'>⚇</span><span class='Number'>0</span></code> to mimic the pervasion of <code><span class='Function'>×</span></code>, we'd like this to work even on nested arguments so we should figure out how the mapping structure works to apply Each appropriately.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4ouI4oycy5wgImFiYyIKCig8y5gg4ouIwqjCqCDiiaAg4oaRIOKGkykgImFiYyI=">↗️</a><pre> <span class='Function'>⋈</span><span class='Modifier'>⌜˜</span> <span class='String'>&quot;abc&quot;</span>
┌─
╵ "aa" "ab" "ac"
"ba" "bb" "bc"
"ca" "cb" "cc"
- <span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span> <span class='Function'>≍</span><span class='Modifier'>¨¨</span> <span class='Function'>≠</span> <span class='Function'>↑</span> <span class='Function'>↓</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span>
+
+ <span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span> <span class='Function'>⋈</span><span class='Modifier'>¨¨</span> <span class='Function'>≠</span> <span class='Function'>↑</span> <span class='Function'>↓</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span>
⟨ ⟨ "aa" "ab" "ac" ⟩ ⟨ "bb" "bc" ⟩ ⟨ "cc" ⟩ ⟩
</pre>
-<p>As before, we can exclude the diagonal, and using Prefixes instead of Suffixes gives us the lower left half instead of the upper right—in terms of the arguments given to <code><span class='Function'>≍</span></code> it reverses the argument pairs and iterates in a different order.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KDzLmCDiiY3CqMKoIDEg4oaTIOKGkykgImFiYyIKKDzLmCDiiY3CqMKoIDEg4oaTIOKGkSkgImFiYyIKKDzLmCDiiY3CqMKoIOKJoCDihpEg4oaRKSAiYWJjIg==">↗️</a><pre> <span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span> <span class='Function'>≍</span><span class='Modifier'>¨¨</span> <span class='Number'>1</span> <span class='Function'>↓</span> <span class='Function'>↓</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span>
+<p>As before, we can exclude the diagonal, and using Prefixes instead of Suffixes gives us the lower left half instead of the upper right—in terms of the arguments given to <code><span class='Function'>⋈</span></code> it reverses the argument pairs and iterates in a different order.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KDzLmCDii4jCqMKoIDEg4oaTIOKGkykgImFiYyIKCig8y5gg4ouIwqjCqCAxIOKGkyDihpEpICJhYmMiCgooPMuYIOKLiMKowqgg4omgIOKGkSDihpEpICJhYmMi">↗️</a><pre> <span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span> <span class='Function'>⋈</span><span class='Modifier'>¨¨</span> <span class='Number'>1</span> <span class='Function'>↓</span> <span class='Function'>↓</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span>
⟨ ⟨ "ab" "ac" ⟩ ⟨ "bc" ⟩ ⟨⟩ ⟩
- <span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span> <span class='Function'>≍</span><span class='Modifier'>¨¨</span> <span class='Number'>1</span> <span class='Function'>↓</span> <span class='Function'>↑</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span>
+
+ <span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span> <span class='Function'>⋈</span><span class='Modifier'>¨¨</span> <span class='Number'>1</span> <span class='Function'>↓</span> <span class='Function'>↑</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span>
⟨ ⟨ "aa" ⟩ ⟨ "ba" "bb" ⟩ ⟨ "ca" "cb" "cc" ⟩ ⟩
- <span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span> <span class='Function'>≍</span><span class='Modifier'>¨¨</span> <span class='Function'>≠</span> <span class='Function'>↑</span> <span class='Function'>↑</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span>
+
+ <span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span> <span class='Function'>⋈</span><span class='Modifier'>¨¨</span> <span class='Function'>≠</span> <span class='Function'>↑</span> <span class='Function'>↑</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span>
⟨ ⟨⟩ ⟨ "ba" ⟩ ⟨ "ca" "cb" ⟩ ⟩
</pre>
<h2 id="slices"><a class="header" href="#slices">Slices</a></h2>
-<p>Prefixes and Suffixes give certain restricted slices of the argument array, where a slice is a contiguous selection of cells. If we want all slices along the first axis, we can take the suffixes of each prefix, or vice-versa:</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oaTwqjihpEgImFiYyIK4oaRwqjihpMgImFiYyI=">↗️</a><pre> <span class='Function'>↓</span><span class='Modifier'>¨</span><span class='Function'>↑</span> <span class='String'>&quot;abc&quot;</span>
+<p>Prefixes and Suffixes give certain restricted slices of the argument array, where a slice is a contiguous selection of major cells. If we want all slices along the first axis, we can take the suffixes of each prefix, or vice-versa:</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oaTwqjihpEgImFiYyIKCuKGkcKo4oaTICJhYmMi">↗️</a><pre> <span class='Function'>↓</span><span class='Modifier'>¨</span><span class='Function'>↑</span> <span class='String'>&quot;abc&quot;</span>
┌─
· ⟨ ⟨⟩ ⟩ ⟨ "a" ⟨⟩ ⟩ ⟨ "ab" "b" ⟨⟩ ⟩ ⟨ "abc" "bc" "c" ⟨⟩ ⟩
+
<span class='Function'>↑</span><span class='Modifier'>¨</span><span class='Function'>↓</span> <span class='String'>&quot;abc&quot;</span>
┌─
· ⟨ ⟨⟩ "a" "ab" "abc" ⟩ ⟨ ⟨⟩ "b" "bc" ⟩ ⟨ ⟨⟩ "c" ⟩ ⟨ ⟨⟩ ⟩
</pre>
<p>Effectively, this parametrizes the slices either by ending then starting index, or by starting index then length. Four empty slices are included because in a list of length 3 there are 4 places an empty slice can start: all the spaces between or outside elements (these also correspond to all the possible positions for the result of <a href="order.html#bins">Bins</a>). The slices can also be parametrized by length and then starting index using <a href="windows.html">Windows</a>.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KCjihpUxK+KJoCnihpXCqDwpICJhYmMiCigo4oaVMSviiaApPMuY4oiY4oaVwqg8KSAiYWJjIiAgIyBTcGxpdCB0aGVtIHRvIG1hdGNoIFByZWZpeGVzL1N1ZmZpeGVz">↗️</a><pre> <span class='Paren'>((</span><span class='Function'>↕</span><span class='Number'>1</span><span class='Function'>+≠</span><span class='Paren'>)</span><span class='Function'>↕</span><span class='Modifier'>¨</span><span class='Function'>&lt;</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KCjihpUxK+KJoCnihpXCqDwpICJhYmMiCgooKOKGlTEr4omgKTzLmOKImOKGlcKoPCkgImFiYyIgICMgU3BsaXQgdGhlbSB0byBtYXRjaCBQcmVmaXhlcy9TdWZmaXhlcw==">↗️</a><pre> <span class='Paren'>((</span><span class='Function'>↕</span><span class='Number'>1</span><span class='Function'>+≠</span><span class='Paren'>)</span><span class='Function'>↕</span><span class='Modifier'>¨</span><span class='Function'>&lt;</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span>
┌─
· ┌┐ ┌─ ┌─ ┌─
╵ ╵"a ╵"ab ╵"abc"
@@ -91,6 +100,7 @@
+
<span class='Paren'>((</span><span class='Function'>↕</span><span class='Number'>1</span><span class='Function'>+≠</span><span class='Paren'>)</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span><span class='Modifier2'>∘</span><span class='Function'>↕</span><span class='Modifier'>¨</span><span class='Function'>&lt;</span><span class='Paren'>)</span> <span class='String'>&quot;abc&quot;</span> <span class='Comment'># Split them to match Prefixes/Suffixes
</span>┌─
· ⟨ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟩ ⟨ "a" "b" "c" ⟩ ⟨ "ab" "bc" ⟩ ⟨ "abc" ⟩