aboutsummaryrefslogtreecommitdiff
path: root/docs/doc
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-03 22:04:33 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-03 22:04:33 -0400
commitefa9759b24567bdda8f6345bd4b6e548e8a278cc (patch)
tree83c9536b201bff4c712b02401921d2ccf7c20a45 /docs/doc
parentc2f267499984ee478d5d6aa34b30acd1f1fff58e (diff)
Editing
Diffstat (limited to 'docs/doc')
-rw-r--r--docs/doc/couple.html2
-rw-r--r--docs/doc/indices.html2
-rw-r--r--docs/doc/leading.html73
3 files changed, 49 insertions, 28 deletions
diff --git a/docs/doc/couple.html b/docs/doc/couple.html
index 1f71bb19..93bf5e74 100644
--- a/docs/doc/couple.html
+++ b/docs/doc/couple.html
@@ -57,7 +57,7 @@
</pre>
<p>Merge is effectively a generalization of Solo and Couple, since Solo is <code><span class='Brace'>{</span><span class='Function'>&gt;</span><span class='Bracket'>⟨</span><span class='Value'>𝕩</span><span class='Bracket'>⟩</span><span class='Brace'>}</span></code> and Couple is <code><span class='Brace'>{</span><span class='Function'>&gt;</span><span class='Bracket'>⟨</span><span class='Value'>𝕨</span><span class='Separator'>,</span><span class='Value'>𝕩</span><span class='Bracket'>⟩</span><span class='Brace'>}</span></code>. Since <code><span class='Function'>≍</span></code> works on the &quot;list&quot; of arguments, it can only add one dimension, but <code><span class='Function'>&gt;</span></code> can take any number of dimensions as its input.</p>
<h2 id="merge-and-array-theory"><a class="header" href="#merge-and-array-theory">Merge and array theory</a></h2>
-<p>In all cases what these functions do is more like reinterpreting existing data than creating new information. In fact, if we ignore the shape and look at the ravels of the arrays involved in a call to Merge, we find that it just <a href="join.html">joins</a> them together. Essentially, Merge is a request to ensure that the inner arrays (which, being independent elements, could be any sort of &quot;ragged&quot; array) can fit together in an array, and then to consider them to be such an array. For this reason, Merge (or a virtual analogue) is used to combine the result cells when calling a function with Rank into a single array.</p>
+<p>In all cases what these functions do is more like reinterpreting existing data than creating new information. In fact, if we ignore the shape and look at the deshaped arrays involved in a call to Merge, we find that it just <a href="join.html">joins</a> them together. Essentially, Merge is a request to ensure that the inner arrays (which, being independent elements, could be any sort of &quot;ragged&quot; array) can fit together in an array, and then to consider them to be such an array. For this reason, Merge (or a virtual analogue) is used to combine the result cells when calling a function with Rank into a single array.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4qWKID4gYQripYog4qWKwqggYQriiL4g4qWKIOKlisKoIGE=">↗️</a><pre> <span class='Function'>β₯Š</span> <span class='Function'>&gt;</span> <span class='Value'>a</span>
"ABrstABuvwABxyzCDrstCDuvwCDxyz"
<span class='Function'>β₯Š</span> <span class='Function'>β₯Š</span><span class='Modifier'>Β¨</span> <span class='Value'>a</span>
diff --git a/docs/doc/indices.html b/docs/doc/indices.html
index 5c0b9ef6..b062b1b3 100644
--- a/docs/doc/indices.html
+++ b/docs/doc/indices.html
@@ -100,5 +100,5 @@
<p>Because indices for cells of the same rank have the same shape, it makes sense to make multiple k-cell indices the rows of an array instead of enclosing them. Here's a definition for Select (<code><span class='Function'>⊏</span></code>) when <code><span class='Value'>𝕨</span></code> is an array of numbers with rank 1 or more: replace each row of <code><span class='Value'>𝕨</span></code> with the cell of <code><span class='Value'>𝕩</span></code> that it indicates, yielding a result with the same depth as <code><span class='Value'>𝕩</span></code> and shape <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='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>.</p>
<p>To match this format, Range (<code><span class='Function'>↕</span></code>) could be changed to return a flat array when given a shape <code><span class='Value'>𝕩</span></code>β€”what is now <code><span class='Function'>&gt;↕</span></code>. Following this pattern, Indices (<code><span class='Function'>/</span></code>) would also return a flat array, where the indices are rows: using the modified Range, <code><span class='Function'>β₯Š/↕</span><span class='Modifier2'>∘</span><span class='Function'>β‰’</span></code>. Here the result cannot retain the argument's array structure; it's always a rank-2 list of rows.</p>
<p>The most interesting feature would be that Select could still allow <code><span class='Value'>𝕨</span></code> to be nested. In this case each element of <code><span class='Value'>𝕨</span></code> would be an array with cell indices for its rows as before. However, each row can now index along multiple axes, allowing some adjacent axes to be dependent while others remain independent. This nicely unifies scatter-point and per-axis selection, and allows a mix of the two. However, it doesn't allow total freedom, as non-adjacent axes can't be combined except by also mixing in all axes in between.</p>
-<p>Group (<code><span class='Function'>βŠ”</span></code>) could accept the same index format for its index argument <code><span class='Value'>𝕨</span></code>. Each depth-1 array in <code><span class='Value'>𝕨</span></code> would correspond to multiple axes in the outer result array, but only a single axis in <code><span class='Value'>𝕩</span></code> and inner arrays. Because the ravel ordering of indices must be used to order cells of inner arrays, this modification is not quite as clean as the change to Select. It's also not so clearly useful, as the same results can be obtained by using atomic indices and reshaping the result.</p>
+<p>Group (<code><span class='Function'>βŠ”</span></code>) could accept the same index format for its index argument <code><span class='Value'>𝕨</span></code>. Each depth-1 array in <code><span class='Value'>𝕨</span></code> would correspond to multiple axes in the outer result array, but only a single axis in <code><span class='Value'>𝕩</span></code> and inner arrays. Because the index ordering of indices must be used to order cells of inner arrays, this modification is not quite as clean as the change to Select. It's also not so clearly useful, as the same results can be obtained by using atomic indices and reshaping the result.</p>
<p>Overall it seems to me that the main use of cell indices of the type discussed here is for the Select primitive, and the other cases are somewhat contrived and awkward. So I've chosen not to support it in BQN at all.</p>
diff --git a/docs/doc/leading.html b/docs/doc/leading.html
index 55b72a40..9b3b408d 100644
--- a/docs/doc/leading.html
+++ b/docs/doc/leading.html
@@ -5,24 +5,27 @@
</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="the-leading-axis-convention"><a class="header" href="#the-leading-axis-convention">The leading axis convention</a></h1>
-<p>Several primitive functions manipulate the right argument, or sometimes both arguments, of an <a href="array.html">array</a> along one or more axes. According to the <a href="https://aplwiki.com/wiki/Leading_axis_theory">leading axis model</a>, it's best to make the primitives operate on initial axes, because the Rank modifier then allows it to apply to later axes as well. Here we'll see how this pattern works in BQN.</p>
+<p>Several primitive functions manipulate the right argument, or sometimes both arguments, of an <a href="array.html">array</a> along one or more axes. According to the <a href="https://aplwiki.com/wiki/Leading_axis_theory">leading axis model</a>, it's best to make the primitives operate on initial axes, because the <a href="rank.html">Rank modifier</a> then allows it to apply to later axes as well. Here we'll see how this pattern works in BQN.</p>
<h2 id="monadic-functions"><a class="header" href="#monadic-functions">Monadic functions</a></h2>
<h3 id="manipulating-cells"><a class="header" href="#manipulating-cells">Manipulating cells</a></h3>
-<p>Most non-arithmetic monadic functions work only on the first axis of the argumentβ€”that is, they treat it as a list of its major cells. The function <a href="shape.html">Length</a> (<code><span class='Function'>β‰ </span></code>) counts these major cells, while <a href="prefixes.html">Prefixes</a> (<code><span class='Function'>↑</span></code>), Suffixes (<code><span class='Function'>↓</span></code>), <a href="reverse.html">Reverse</a> (<code><span class='Function'>⌽</span></code>), and <a href="select.html">First Cell</a> (<code><span class='Function'>⊏</span></code>) move them around. The <a href="fold.html#insert">Insert</a> (<code><span class='Modifier'>˝</span></code>) and <a href="scan.html">Scan</a> (<code><span class='Modifier'>`</span></code>) modifiers also yield functions that work along the first axis; in contrast, <a href="fold.html">Fold</a> (<code><span class='Modifier'>Β΄</span></code>) requires <code><span class='Value'>𝕩</span></code> to be a list, as it works on elements.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIGEg4oaQIDPigL8yIOKliiAiYWJjZGVmIiAgIyBBbiBhcnJheSB3aXRoIHRocmVlIG1ham9yIGNlbGxzCuKKjyBhICAgICAgICAgICAgICAgICAgICMgR2V0IHRoZSBmaXJzdCBtYWpvciBjZWxsCuKMvSBhICAgICAgICAgICAgICAgICAgICMgUmV2ZXJzZSB0aGUgY2VsbHMK4oqjYCBhICAgICAgICAgICAgICAgICAgIyBSZXBsaWNhdGUgdGhlIGZpcnN0IGNlbGw=">↗️</a><pre> <span class='Function'>⊒</span> <span class='Value'>a</span> <span class='Gets'>←</span> <span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>2</span> <span class='Function'>β₯Š</span> <span class='String'>&quot;abcdef&quot;</span> <span class='Comment'># An array with three major cells
+<p>Most monadic functions that deal with structure at all (that is, not arithmetic) work only on the first axis of the argument. Usually, they treat it as a list of its <a href="array.html#cells">major cells</a>. The function <a href="shape.html">Length</a> (<code><span class='Function'>β‰ </span></code>) counts these major cells, while <a href="prefixes.html">Prefixes</a> (<code><span class='Function'>↑</span></code>), Suffixes (<code><span class='Function'>↓</span></code>), <a href="reverse.html">Reverse</a> (<code><span class='Function'>⌽</span></code>), and <a href="select.html">First Cell</a> (<code><span class='Function'>⊏</span></code>) move them around. The <a href="fold.html#insert">Insert</a> (<code><span class='Modifier'>˝</span></code>) and <a href="scan.html">Scan</a> (<code><span class='Modifier'>`</span></code>) modifiers also yield functions that work along the first axis; <a href="fold.html">Fold</a> (<code><span class='Modifier'>Β΄</span></code>) requires <code><span class='Value'>𝕩</span></code> to be a list but does go along the first (only) axis of that list.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIGEg4oaQIDPigL8yIOKliiAiYWJjZGVmIiAgIyBBbiBhcnJheSB3aXRoIHRocmVlIG1ham9yIGNlbGxzCgriio8gYSAgICAgICAgICAgICAgICAgICAjIEdldCB0aGUgZmlyc3QgbWFqb3IgY2VsbAoK4oy9IGEgICAgICAgICAgICAgICAgICAgIyBSZXZlcnNlIHRoZSBjZWxscwoK4oqjYCBhICAgICAgICAgICAgICAgICAgIyBSZXBsaWNhdGUgdGhlIGZpcnN0IGNlbGw=">↗️</a><pre> <span class='Function'>⊒</span> <span class='Value'>a</span> <span class='Gets'>←</span> <span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>2</span> <span class='Function'>β₯Š</span> <span class='String'>&quot;abcdef&quot;</span> <span class='Comment'># An array with three major cells
</span>β”Œβ”€
β•΅"ab
cd
ef"
β”˜
+
<span class='Function'>⊏</span> <span class='Value'>a</span> <span class='Comment'># Get the first major cell
</span>"ab"
+
<span class='Function'>⌽</span> <span class='Value'>a</span> <span class='Comment'># Reverse the cells
</span>β”Œβ”€
β•΅"ef
cd
ab"
β”˜
+
<span class='Function'>⊣</span><span class='Modifier'>`</span> <span class='Value'>a</span> <span class='Comment'># Replicate the first cell
</span>β”Œβ”€
β•΅"ab
@@ -30,15 +33,17 @@
ab"
β”˜
</pre>
-<p>To use these functions on another axis, use the Rank (<code><span class='Modifier2'>βŽ‰</span></code>) or Cells (<code><span class='Modifier'>˘</span></code>) modifier to find the one you want. For a rank 2 array like <code><span class='Value'>a</span></code>, the most you'll ever need is a single <code><span class='Modifier'>˘</span></code>, because a function works on axis 0 by default, and there's only one other axis.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqPy5ggYSAgICAgICAgICAgICAgICAgICMgRmlyc3QgY29sdW1uCuKMvcuYIGEgICAgICAgICAgICAgICAgICAjIFN3YXAgdGhlIGNvbHVtbnMK4oqjYMuYIGEgICAgICAgICAgICAgICAgICMgUmVwbGljYXRlIGFsb25nIHJvd3M=">↗️</a><pre> <span class='Function'>⊏</span><span class='Modifier'>˘</span> <span class='Value'>a</span> <span class='Comment'># First column
+<p>To use these functions on another axis, use the <a href="rank.html#rank">Rank</a> (<code><span class='Modifier2'>βŽ‰</span></code>) or <a href="rank.html#cells">Cells</a> (<code><span class='Modifier'>˘</span></code>) modifier to find the one you want. For a rank 2 array like <code><span class='Value'>a</span></code>, the most you'll ever need is a single <code><span class='Modifier'>˘</span></code>, because after the leading one there's only one other axis.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqPy5ggYSAgICAgICAgICAgICAgICAgICMgRmlyc3QgY29sdW1uCgrijL3LmCBhICAgICAgICAgICAgICAgICAgIyBTd2FwIHRoZSBjb2x1bW5zCgriiqNgy5ggYSAgICAgICAgICAgICAgICAgIyBSZXBsaWNhdGUgYWxvbmcgcm93cw==">↗️</a><pre> <span class='Function'>⊏</span><span class='Modifier'>˘</span> <span class='Value'>a</span> <span class='Comment'># First column
</span>"ace"
+
<span class='Function'>⌽</span><span class='Modifier'>˘</span> <span class='Value'>a</span> <span class='Comment'># Swap the columns
</span>β”Œβ”€
β•΅"ba
dc
fe"
β”˜
+
<span class='Function'>⊣</span><span class='Modifier'>`˘</span> <span class='Value'>a</span> <span class='Comment'># Replicate along rows
</span>β”Œβ”€
β•΅"aa
@@ -46,8 +51,8 @@
ee"
β”˜
</pre>
-<p>In these three cases above, the results are the same as you would get from <a href="transpose.html">transposing</a> before and after (this has no effect on the result of <code><span class='Function'>⊏</span><span class='Modifier'>˘</span></code>, since it has rank 1). But in the following cases, the structure is quite different: <code><span class='Function'>↑</span><span class='Value'>a</span></code> is a list of matrices while <code><span class='Function'>↑</span><span class='Modifier'>˘</span><span class='Value'>a</span></code> is a matrix of lists. This is because the functions <code><span class='Function'>⊏</span></code>, <code><span class='Function'>⌽</span></code>, and <code><span class='Function'>⊣</span><span class='Modifier'>`</span></code> leave the trailing axis structure intact (<code><span class='Function'>⊏</span></code> removes one axis); taking into account that Rank or Cells always preserves the leading or frame axes, all axes are preserved (except the one removed by <code><span class='Function'>⊏</span></code>). In contrast, Prefixes or Suffixes will push some axes down in depth, and the number of axes that are pushed down in this way changes with the rank of application. More precisely, these functions move axes after the first from the argument itself to result elements, and create two axes from the first axis, with one of them forming the sole result axis and the other joining the rest as an element axis.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oaRIGEgICAgICAgICAgICAgICAgICAgIyBQcmVmaXhlcyBvZiBhOiAgICByYW5rcyAxfDIK4oaRy5ggYSAgICAgICAgICAgICAgICAgICMgUHJlZml4ZXMgb2Ygcm93czogcmFua3MgMnwxCuKIvsudIGEgICAgICAgICAgICAgICAgICAjIEpvaW4gdGhlIGNlbGxzCuKIvsudy5ggYSAgICAgICAgICAgICAgICAgIyBKb2luLWluc2VydCBpcyBhIG5vLW9wIG9uIGxpc3Rz">↗️</a><pre> <span class='Function'>↑</span> <span class='Value'>a</span> <span class='Comment'># Prefixes of a: ranks 1|2
+<p>In these three cases above, the results are the same as you would get from <a href="transpose.html">transposing</a> before and after (which does nothing to the rank-1 result of <code><span class='Function'>⊏</span><span class='Modifier'>˘</span></code>, but that's what's wanted). But in the following cases, the structure is quite different: <code><span class='Function'>↑</span><span class='Value'>a</span></code> is a list of matrices while <code><span class='Function'>↑</span><span class='Modifier'>˘</span><span class='Value'>a</span></code> is a matrix of lists. This is because the functions <code><span class='Function'>⊏</span></code>, <code><span class='Function'>⌽</span></code>, and <code><span class='Function'>⊣</span><span class='Modifier'>`</span></code> leave the trailing axis structure intact (<code><span class='Function'>⊏</span></code> removes one axis); taking into account that Rank or Cells always preserves the leading or frame axes, all axes are preserved (except the one removed by <code><span class='Function'>⊏</span></code>). But Prefixes or Suffixes move axes after the first from the whole of <code><span class='Value'>𝕩</span></code> to elements of the result, pushing them down in depth, and Rank won't undo this sort of structural change.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oaRIGEgICAgICAgICAgICAgICAgICAgIyBQcmVmaXhlcyBvZiBhOiAgICByYW5rcyAxfDIKCuKGkcuYIGEgICAgICAgICAgICAgICAgICAjIFByZWZpeGVzIG9mIHJvd3M6IHJhbmtzIDJ8MQoK4oi+y50gYSAgICAgICAgICAgICAgICAgICMgSm9pbiB0aGUgY2VsbHMKCuKIvsudy5ggYSAgICAgICAgICAgICAgICAgIyBKb2luLWluc2VydCBpcyBhIG5vLW9wIG9uIGxpc3Rz">↗️</a><pre> <span class='Function'>↑</span> <span class='Value'>a</span> <span class='Comment'># Prefixes of a: ranks 1|2
</span>β”Œβ”€
Β· ↕0β€Ώ2 β”Œβ”€ β”Œβ”€ β”Œβ”€
β•΅"ab" β•΅"ab β•΅"ab
@@ -55,14 +60,17 @@
β”˜ ef"
β”˜
β”˜
+
<span class='Function'>↑</span><span class='Modifier'>˘</span> <span class='Value'>a</span> <span class='Comment'># Prefixes of rows: ranks 2|1
</span>β”Œβ”€
β•΅ ⟨⟩ "a" "ab"
⟨⟩ "c" "cd"
⟨⟩ "e" "ef"
β”˜
+
<span class='Function'>∾</span><span class='Modifier'>˝</span> <span class='Value'>a</span> <span class='Comment'># Join the cells
</span>"abcdef"
+
<span class='Function'>∾</span><span class='Modifier'>˝˘</span> <span class='Value'>a</span> <span class='Comment'># Join-insert is a no-op on lists
</span>β”Œβ”€
β•΅"ab
@@ -71,33 +79,40 @@
β”˜
</pre>
<p><a href="couple.html">Solo</a> (<code><span class='Function'>≍</span></code>), something of a maverick, manages to act on <em>zero</em> leading axes of <code><span class='Value'>𝕩</span></code> by creating the first axis of the <em>result</em> instead. Because it doesn't need any axis to work, it can go in front of either axis but also past the last one by working with rank 0, a case where most array functions would give an error.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omiIOKJjSBhICAgICAgICAgICAgICAgICAjIFNvbG8gYWRkcyBhIGxlbmd0aC0xIGF4aXMKYSDiiaEg4oqPIOKJjSBhICAgICAgICAgICAgICMgRmlyc3QgQ2VsbCB1bmRvZXMgdGhpcwriiaIg4omNy5ggYSAgICAgICAgICAgICAgICAjIFNvbG8gY2FuIGluc2VydCB0aGUgYXhpcyBkZWVwZXLigKYK4omiIOKJjeKOiTAgYSAgICAgICAgICAgICAgICMg4oCmb3IgZGVlcGVyIHN0aWxsLg==">↗️</a><pre> <span class='Function'>β‰’</span> <span class='Function'>≍</span> <span class='Value'>a</span> <span class='Comment'># Solo adds a length-1 axis
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omiIOKJjSBhICAgICAgICAgICAgICAgICAjIFNvbG8gYWRkcyBhIGxlbmd0aC0xIGF4aXMKCmEg4omhIOKKjyDiiY0gYSAgICAgICAgICAgICAjIEZpcnN0IENlbGwgdW5kb2VzIHRoaXMKCuKJoiDiiY3LmCBhICAgICAgICAgICAgICAgICMgU29sbyBjYW4gaW5zZXJ0IHRoZSBheGlzIGRlZXBlcuKApgoK4omiIOKJjeKOiTAgYSAgICAgICAgICAgICAgICMg4oCmb3IgZGVlcGVyIHN0aWxsLg==">↗️</a><pre> <span class='Function'>β‰’</span> <span class='Function'>≍</span> <span class='Value'>a</span> <span class='Comment'># Solo adds a length-1 axis
</span>⟨ 1 3 2 ⟩
+
<span class='Value'>a</span> <span class='Function'>≑</span> <span class='Function'>⊏</span> <span class='Function'>≍</span> <span class='Value'>a</span> <span class='Comment'># First Cell undoes this
</span>1
+
<span class='Function'>β‰’</span> <span class='Function'>≍</span><span class='Modifier'>˘</span> <span class='Value'>a</span> <span class='Comment'># Solo can insert the axis deeper…
</span>⟨ 3 1 2 ⟩
+
<span class='Function'>β‰’</span> <span class='Function'>≍</span><span class='Modifier2'>βŽ‰</span><span class='Number'>0</span> <span class='Value'>a</span> <span class='Comment'># …or deeper still.
</span>⟨ 3 2 1 ⟩
</pre>
<h3 id="comparing-cells"><a class="header" href="#comparing-cells">Comparing cells</a></h3>
-<p>The functions in the last section manipulate cells in the same way regardless of what data they contain. Other functions compare cells to each other, either testing whether they match or how they are ordered relative to one another. The two <a href="order.html">Grade</a> functions <code><span class='Function'>⍋⍒</span></code>, and the <a href="selfcmp.html">self-search</a> functions Classify (<code><span class='Function'>⊐</span></code>), Mark Firsts (<code><span class='Function'>∊</span></code>), and Occurrence Count (<code><span class='Function'>βŠ’</span></code>), each give a list result, with one number for each cell. We can see below that Occurrence Count returns the same results even as we make the argument cells more complicated, because the changes made preserve the matching of cells.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=cyDihpAgImFicmFjYWRhYnJhIgriipIgcwriipIg4omNy5ggcwriipIgcyDiiL7ijokw4oC/MSAic3VmZml4Ig==">↗️</a><pre> <span class='Value'>s</span> <span class='Gets'>←</span> <span class='String'>&quot;abracadabra&quot;</span>
+<p>The functions in the last section manipulate cells in the same way regardless of what data they contain. Other functions compare cells to each other, either testing whether they match or how they are ordered relative to one another. The two <a href="order.html#grade">Grade</a> functions <code><span class='Function'>⍋⍒</span></code>, and the <a href="selfcmp.html">self-search</a> functions Classify (<code><span class='Function'>⊐</span></code>), Mark Firsts (<code><span class='Function'>∊</span></code>), and Occurrence Count (<code><span class='Function'>βŠ’</span></code>), each give a list result, with one number for each cell. We can see below that <a href="selfcmp.html#occurrence-count">Occurrence Count</a> returns the same results even as we make the argument cells more complicated, because the changes made preserve the matching of cells.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=cyDihpAgImFicmFjYWRhYnJhIgoK4oqSIHMKCuKKkiDiiY3LmCBzCgriipIgcyDiiL7ijokw4oC/MSAic3VmZml4Ig==">↗️</a><pre> <span class='Value'>s</span> <span class='Gets'>←</span> <span class='String'>&quot;abracadabra&quot;</span>
+
<span class='Function'>βŠ’</span> <span class='Value'>s</span>
⟨ 0 0 0 1 0 2 0 3 1 1 4 ⟩
+
<span class='Function'>βŠ’</span> <span class='Function'>≍</span><span class='Modifier'>˘</span> <span class='Value'>s</span>
⟨ 0 0 0 1 0 2 0 3 1 1 4 ⟩
+
<span class='Function'>βŠ’</span> <span class='Value'>s</span> <span class='Function'>∾</span><span class='Modifier2'>βŽ‰</span><span class='Number'>0</span><span class='Ligature'>β€Ώ</span><span class='Number'>1</span> <span class='String'>&quot;suffix&quot;</span>
⟨ 0 0 0 1 0 2 0 3 1 1 4 ⟩
</pre>
-<p>The two Sort functions <code><span class='Function'>∧∨</span></code> and Deduplicate (<code><span class='Function'>⍷</span></code>) move cells around based on their ordering. The length of Deduplicate's result depends on how many unique cells the argument has, so you'd better be careful if you want to apply it to argument cells! However, the result of sorting has the same shape as the argument, so it can always safely be applied at any rank, for example to the rows of an array.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIGIg4oaQIDTigL81IOKliiDihpU0CuKIqMuYIGI=">↗️</a><pre> <span class='Function'>⊒</span> <span class='Value'>b</span> <span class='Gets'>←</span> <span class='Number'>4</span><span class='Ligature'>β€Ώ</span><span class='Number'>5</span> <span class='Function'>β₯Š</span> <span class='Function'>↕</span><span class='Number'>4</span>
+<p>The two <a href="order.html#sort">Sort</a> functions <code><span class='Function'>∧∨</span></code> and <a href="selfcmp.html#deduplicate">Deduplicate</a> (<code><span class='Function'>⍷</span></code>) move cells around based on their ordering. The length of Deduplicate's result depends on how many unique cells the argument has, so you'd better be careful if you want to apply it to argument cells! However, the result of sorting has the same shape as the argument, so it can always safely be applied at any rank, for example to the rows of an array.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIGIg4oaQIDTigL81IOKliiDihpU0CgriiKjLmCBi">↗️</a><pre> <span class='Function'>⊒</span> <span class='Value'>b</span> <span class='Gets'>←</span> <span class='Number'>4</span><span class='Ligature'>β€Ώ</span><span class='Number'>5</span> <span class='Function'>β₯Š</span> <span class='Function'>↕</span><span class='Number'>4</span>
β”Œβ”€
β•΅ 0 1 2 3 0
1 2 3 0 1
2 3 0 1 2
3 0 1 2 3
β”˜
+
<span class='Function'>∨</span><span class='Modifier'>˘</span> <span class='Value'>b</span>
β”Œβ”€
β•΅ 3 2 1 0 0
@@ -107,13 +122,13 @@
β”˜
</pre>
<h3 id="other-monadic-functions"><a class="header" href="#other-monadic-functions">Other monadic functions</a></h3>
-<p>Not all functions work on the first axis in a straightforward manner. <a href="transpose.html">Transpose</a> <code><span class='Function'>⍉</span></code> moves the first axis to the end, so while it focuses on the first one, it shifts every axis of <code><span class='Value'>𝕩</span></code>. <a href="join.html">Join</a> <code><span class='Function'>∾</span></code> also works on every axis of its argument, and applies to the leading axes of <code><span class='Value'>𝕩</span></code>'s <em>elements</em> instead: these leading inner axes are matched up with the outer axes, and trailing inner axes are allowed but the elements must have rank at least as high as the argument array.</p>
-<p>The other two monadic functions that work on high-rank arguments are <a href="reshape.html#deshape">Deshape</a> (<code><span class='Function'>β₯Š</span></code>) and <a href="pick.html#first">First</a> (<code><span class='Function'>βŠ‘</span></code>). These treat <code><span class='Value'>𝕩</span></code> as one long list, ordered by its element indices. This ordering privileges leading axes (in fact, it is the reason for the choice of leading axes in the leading axis convention), but these functions can't really be said to work on leading axes: they apply to all axes.</p>
-<p>The <a href="map.html">Each</a> (<code><span class='Modifier'>¨</span></code>) and <a href="map.html#table">Table</a> (<code><span class='Modifier'>⌜</span></code>) modifiers return functions which are the same in the monadic case. These functions simply go through all elements of the argument array without regard for its multi-dimensional structure (the operand is applied to elements in index order, matching Deshape; this matters if it has side effects). Similarly, monadic arithmetic functions do not have any sort of leading axis dependence.</p>
+<p>Not all functions work on the first axis in a straightforward manner. <a href="transpose.html">Transpose</a> <code><span class='Function'>⍉</span></code> moves the first axis of <code><span class='Value'>𝕩</span></code> to the end, so while it focuses on the first one, it shifts every other axis too. <a href="join.html">Join</a> <code><span class='Function'>∾</span></code> also works on every axis of its argument, and applies to the leading axes of <code><span class='Value'>𝕩</span></code>'s <em>elements</em> instead: these leading inner axes are matched up with the outer axes, and trailing inner axes are allowed but the elements must have rank (after extension) at least as high as the argument array.</p>
+<p>The other two monadic functions that work on high-rank arguments are <a href="reshape.html#deshape">Deshape</a> (<code><span class='Function'>β₯Š</span></code>) and <a href="pick.html#first">First</a> (<code><span class='Function'>βŠ‘</span></code>). These treat <code><span class='Value'>𝕩</span></code> as one long list, ordered by its element indices. This ordering privileges leading axes (in fact, it's the reason for the choice of leading axes in the leading axis convention), but these functions can't really be said to work on leading axes: they apply to all axes.</p>
+<p>The <a href="map.html">Each</a> (<code><span class='Modifier'>Β¨</span></code>) and <a href="map.html#table">Table</a> (<code><span class='Modifier'>⌜</span></code>) modifiers behave the same in the monadic case: they go through all elements of <code><span class='Value'>𝕩</span></code> without regard for its multi-dimensional structure (in index order, matching Deshape; this matters if it has side effects). Similarly, monadic arithmetic functions don't have any sort of leading axis dependence.</p>
<h2 id="dyadic-functions"><a class="header" href="#dyadic-functions">Dyadic functions</a></h2>
-<p>For dyadic functions the pattern of working on only one argument axis is not so common. Only two functions can be said to follow it roughly: <a href="join.html">Join to</a> (<code><span class='Function'>∾</span></code>) combines two arrays along one axis, using the first axis of both arguments if they have the same rank and of the higher-rank argument if they differ by one. <a href="couple.html">Couple</a> (<code><span class='Function'>≍</span></code>), like Solo, does not manipulate the argument axes but adds a result axis. There are also some functions that can't be limited to leading axes: <a href="reshape.html">Reshape</a> (<code><span class='Function'>β₯Š</span></code>) treats <code><span class='Value'>𝕩</span></code> as one long list, and <a href="pick.html">Pick</a> (<code><span class='Function'>βŠ‘</span></code>) requires each index to be as long as <code><span class='Value'>𝕩</span></code>'s rank, because it selects elements and not cells from <code><span class='Value'>𝕩</span></code>.</p>
+<p>For dyadic functions the pattern of working on only one argument axis is not so common. Only two functions can be said to follow it roughly: <a href="join.html">Join to</a> (<code><span class='Function'>∾</span></code>) combines two arrays along one axis, using the first axis of both arguments if they have the same rank and of the higher-rank argument if they differ by one. <a href="couple.html">Couple</a> (<code><span class='Function'>≍</span></code>), like Solo, doesn't manipulate the argument axes but adds a result axis. There are also some functions that can't be limited to leading axes: <a href="pick.html">Pick</a> (<code><span class='Function'>βŠ‘</span></code>) requires each index to be as long as <code><span class='Value'>𝕩</span></code>'s rank, because it selects elements and not cells from <code><span class='Value'>𝕩</span></code>, and <a href="reshape.html">Reshape</a> (<code><span class='Function'>β₯Š</span></code>) treats <code><span class='Value'>𝕩</span></code> as one long list. In fact I think I <a href="../commentary/problems.html#deshape-and-reshape-cant-ignore-trailing-axes">got Reshape wrong</a> by rejecting J's leading axis form, but it's too late to go back on that, especially given that it wouldn't make much sense for it to share the glyph <code><span class='Function'>β₯Š</span></code> with Deshape.</p>
<h3 id="multiple-axes"><a class="header" href="#multiple-axes">Multiple axes</a></h3>
-<p>Instead of always working on a single axis, many dyadic functions work on one axis by default, but also allow a left argument with multiple elements corresponding to leading axes of <code><span class='Value'>𝕩</span></code>. To decide which of the two possibilities applies, these functions test the depth of <code><span class='Value'>𝕨</span></code>, a convention that is discussed in the <a href="depth.html#testing-depth-for-multiple-axis-primitives">depth</a> documentation. A left argument that applies to one axis has a particular depth; <code><span class='Value'>𝕨</span></code> can also be a list of such arguments.</p>
+<p>Instead of always working on a single axis, many dyadic functions work on one axis by default, but also allow a left argument with multiple elements corresponding to leading axes of <code><span class='Value'>𝕩</span></code>. To decide which of the two possibilities applies, these functions test the depth of <code><span class='Value'>𝕨</span></code>, a convention that is discussed <a href="depth.html#testing-depth-for-multiple-axis-primitives">in the depth documentation</a>. A left argument that applies to one axis has a particular depth; <code><span class='Value'>𝕨</span></code> can also be a list of such arguments.</p>
<table>
<thead>
<tr>
@@ -132,7 +147,7 @@
</tr>
</tbody>
</table>
-<p>Functions such as Take and Drop use a single number per axis. When <code><span class='Value'>𝕨</span></code> is a list of numbers, they apply to initial axes. Observing the operation of <a href="reverse.html#rotate">Rotate</a> on the result of <a href="range.html">Range</a> is instructive:</p>
+<p>Functions such as Take and Drop use a single number per axis. When <code><span class='Value'>𝕨</span></code> is a list of numbers, they apply to initial axes. The operation of <a href="reverse.html#rotate">Rotate</a> on the result of <a href="range.html">Range</a> is instructive:</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MuKAvzEg4oy9IOKGlTPigL81">↗️</a><pre> <span class='Number'>2</span><span class='Ligature'>β€Ώ</span><span class='Number'>1</span> <span class='Function'>⌽</span> <span class='Function'>↕</span><span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>5</span>
β”Œβ”€
β•΅ ⟨ 2 1 ⟩ ⟨ 2 2 ⟩ ⟨ 2 3 ⟩ ⟨ 2 4 ⟩ ⟨ 2 0 ⟩
@@ -140,14 +155,14 @@
⟨ 1 1 ⟩ ⟨ 1 2 ⟩ ⟨ 1 3 ⟩ ⟨ 1 4 ⟩ ⟨ 1 0 ⟩
β”˜
</pre>
-<p>The array is shifted once to the left and twice upward, so that the first index (by ravel order) is now <code><span class='Function'>βŠ‘</span><span class='Number'>2</span><span class='Ligature'>β€Ώ</span><span class='Number'>1</span><span class='Function'>βŒ½β†•</span><span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>5</span> <span class='Gets'>←→</span> <span class='Number'>2</span><span class='Ligature'>β€Ώ</span><span class='Number'>1</span></code>. To see how values are matched to leading axes, we can look at how <a href="take.html">Drop</a> changes the shape of its argument:</p>
+<p>The array is shifted once to the left and twice upward, so that the first index (by index order) is now <code><span class='Function'>βŠ‘</span><span class='Number'>2</span><span class='Ligature'>β€Ώ</span><span class='Number'>1</span><span class='Function'>βŒ½β†•</span><span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>5</span> <span class='Gets'>←→</span> <span class='Number'>2</span><span class='Ligature'>β€Ώ</span><span class='Number'>1</span></code>. To see how values are matched to leading axes, we can look at how <a href="take.html">Drop</a> changes the shape of its argument:</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omiIDPigL8yIOKGkyA34oC/N+KAvzfigL834qWKImFiYyI=">↗️</a><pre> <span class='Function'>β‰’</span> <span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>2</span> <span class='Function'>↓</span> <span class='Number'>7</span><span class='Ligature'>β€Ώ</span><span class='Number'>7</span><span class='Ligature'>β€Ώ</span><span class='Number'>7</span><span class='Ligature'>β€Ώ</span><span class='Number'>7</span><span class='Function'>β₯Š</span><span class='String'>&quot;abc&quot;</span>
⟨ 4 5 7 7 ⟩
</pre>
<p>Functions with single-axis depth 1 tend to be more complicated; see for example <a href="group.html#multidimensional-grouping">Group</a>.</p>
<h3 id="leading-axis-agreement"><a class="header" href="#leading-axis-agreement">Leading axis agreement</a></h3>
-<p><a href="arithmetic.html">Arithmetic</a> functions, and the <a href="map.html#each">Each</a> (<code><span class='Modifier'>Β¨</span></code>) and <a href="depth.html#the-depth-modifier">Depth</a> (<code><span class='Modifier2'>βš‡</span></code>) modifiers, use leading axis agreement to match their arguments together. All axes of the lower-rank argument are matched with the leading axes of the higher-rank one, and axes matched together must have the same length. After pairing axes in this way, a single element of the lower-rank argument might correspond to any number of elements of the higher-rank one. It's reused for each of those corresponding elements.</p>
-<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIHgg4oaQIDPigL8y4oC/NCDipYog4oaVNjAgICAgICMgQSByYW5rLTMgYXJyYXkKMTAw4oC/MOKAvzIwMCArIHggICAgICAgICAjIDAtY2VsbHMgcGFpcmVkIHdpdGggMi1jZWxscwriiqIgYyDihpAgMTAwIMOXIDMgPeKMnOKXi+KGlSAyICAjIEEgcmFuay0yIGFycmF5IHRvIGFkZApjICsgeCAgICAgICAgICAgICAgICAgIyAwLWNlbGxzIHBhaXJlZCB3aXRoIDEtY2VsbHMKeCArIHggICAgICAgICAgICAgICAgICMgUGFpcndpc2UgYWRkaXRpb24=">↗️</a><pre> <span class='Function'>⊒</span> <span class='Value'>x</span> <span class='Gets'>←</span> <span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>2</span><span class='Ligature'>β€Ώ</span><span class='Number'>4</span> <span class='Function'>β₯Š</span> <span class='Function'>↕</span><span class='Number'>60</span> <span class='Comment'># A rank-3 array
+<p><a href="arithmetic.html">Arithmetic</a> functions, and the <a href="map.html#each">Each</a> (<code><span class='Modifier'>Β¨</span></code>) and <a href="depth.html#the-depth-modifier">Depth</a> (<code><span class='Modifier2'>βš‡</span></code>) modifiers, use leading axis agreement to match their arguments together. It's a bit like NumPy or Julia broadcasting, but these mostly match trailing, not leading, axes. In BQN, all axes of the lower-rank argument are matched with the leading axes of the higher-rank one, and axes matched together must have the same length. After pairing axes in this way, a single element of the lower-rank argument might correspond to any number of elements of the higher-rank one. It's reused for each of those corresponding elements.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIHgg4oaQIDPigL8y4oC/NCDipYog4oaVNjAgICAgICMgQSByYW5rLTMgYXJyYXkKCjEwMOKAvzDigL8yMDAgKyB4ICAgICAgICAgIyAwLWNlbGxzIHBhaXJlZCB3aXRoIDItY2VsbHM=">↗️</a><pre> <span class='Function'>⊒</span> <span class='Value'>x</span> <span class='Gets'>←</span> <span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>2</span><span class='Ligature'>β€Ώ</span><span class='Number'>4</span> <span class='Function'>β₯Š</span> <span class='Function'>↕</span><span class='Number'>60</span> <span class='Comment'># A rank-3 array
</span>β”Œβ”€
β•Ž 0 1 2 3
4 5 6 7
@@ -158,6 +173,7 @@
16 17 18 19
20 21 22 23
β”˜
+
<span class='Number'>100</span><span class='Ligature'>β€Ώ</span><span class='Number'>0</span><span class='Ligature'>β€Ώ</span><span class='Number'>200</span> <span class='Function'>+</span> <span class='Value'>x</span> <span class='Comment'># 0-cells paired with 2-cells
</span>β”Œβ”€
β•Ž 100 101 102 103
@@ -169,12 +185,15 @@
216 217 218 219
220 221 222 223
β”˜
- <span class='Function'>⊒</span> <span class='Value'>c</span> <span class='Gets'>←</span> <span class='Number'>100</span> <span class='Function'>Γ—</span> <span class='Number'>3</span> <span class='Function'>=</span><span class='Modifier'>⌜</span><span class='Modifier2'>β—‹</span><span class='Function'>↕</span> <span class='Number'>2</span> <span class='Comment'># A rank-2 array to add
+</pre>
+<p>That's shape <code><span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>2</span><span class='Ligature'>β€Ώ</span><span class='Number'>4</span></code> matched with shape <code><span class='Bracket'>⟨</span><span class='Number'>3</span><span class='Bracket'>⟩</span></code>: the leading <code><span class='Number'>3</span></code> agrees. Now to match with <code><span class='Number'>3</span><span class='Ligature'>β€Ώ</span><span class='Number'>2</span></code>:</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIGMg4oaQIDEwMCDDlyAzID3ijJzil4vihpUgMiAgIyBBIHJhbmstMiBhcnJheSB0byBhZGQKCmMgKyB4ICAgICAgICAgICAgICAgICAjIDAtY2VsbHMgcGFpcmVkIHdpdGggMS1jZWxscw==">↗️</a><pre> <span class='Function'>⊒</span> <span class='Value'>c</span> <span class='Gets'>←</span> <span class='Number'>100</span> <span class='Function'>Γ—</span> <span class='Number'>3</span> <span class='Function'>=</span><span class='Modifier'>⌜</span><span class='Modifier2'>β—‹</span><span class='Function'>↕</span> <span class='Number'>2</span> <span class='Comment'># A rank-2 array to add
</span>β”Œβ”€
β•΅ 100 0
0 100
0 0
β”˜
+
<span class='Value'>c</span> <span class='Function'>+</span> <span class='Value'>x</span> <span class='Comment'># 0-cells paired with 1-cells
</span>β”Œβ”€
β•Ž 100 101 102 103
@@ -186,7 +205,9 @@
16 17 18 19
20 21 22 23
β”˜
- <span class='Value'>x</span> <span class='Function'>+</span> <span class='Value'>x</span> <span class='Comment'># Pairwise addition
+</pre>
+<p>And of course, identical shapes agree:</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=eCArIHggICAgICAgICAgICAgICAgICMgUGFpcndpc2UgYWRkaXRpb24=">↗️</a><pre> <span class='Value'>x</span> <span class='Function'>+</span> <span class='Value'>x</span> <span class='Comment'># Pairwise addition
</span>β”Œβ”€
β•Ž 0 2 4 6
8 10 12 14
@@ -198,10 +219,10 @@
40 42 44 46
β”˜
</pre>
-<p>If one argument is a unit, that is, it has no axes, then leading axis agreement reduces to APL's &quot;scalar extension&quot; (where &quot;scalar&quot; is equivalent to BQN's &quot;unit&quot;), where a single unit is matched with an entire array by repeating it at every application. A unit always agrees with any other array under leading axis agreement because it has no axes whose lengths would need to be checked.</p>
-<p>With leading axis agreement, there are <code><span class='Value'>k</span><span class='Function'>+</span><span class='Number'>1</span></code> shapes for arrays that can be added (or any other function with Each) to a given array <code><span class='Value'>x</span></code> without changing its rank. These are precisely the prefixes of <code><span class='Function'>β‰’</span><span class='Value'>x</span></code>, with ranks from <code><span class='Number'>0</span></code> to <code><span class='Value'>k</span></code> inclusive. Arrays with larger rank can also be used as the other argument, but then the result shape will match that argument and not <code><span class='Value'>x</span></code>.</p>
+<p>If one argument is a <a href="enclose.html#whats-a-unit">unit</a>, that is, it has no axes, then leading axis agreement reduces to APL's &quot;scalar extension&quot; (where &quot;scalar&quot; is equivalent to BQN's &quot;unit&quot;), where a single unit is matched with an entire array by repeating it at every application. A unit always agrees with any other array under leading axis agreement, because it has no axes whose lengths would need to be checked.</p>
+<p>With leading axis agreement, there are <code><span class='Value'>k</span><span class='Function'>+</span><span class='Number'>1</span></code> shapes for arrays that can be added (or any other function with Each) to a given array <code><span class='Value'>a</span></code> without changing its rank. These are precisely the prefixes of <code><span class='Function'>β‰’</span><span class='Value'>a</span></code>, with ranks from <code><span class='Number'>0</span></code> to <code><span class='Value'>k</span></code> inclusive. Arrays with larger rank can also be used as the other argument, but then the result shape will match that argument and not <code><span class='Value'>a</span></code>.</p>
<h3 id="search-functions"><a class="header" href="#search-functions">Search functions</a></h3>
-<p>The <a href="search.html">search functions</a>, Index of (<code><span class='Function'>⊐</span></code>), Progressive Index of (<code><span class='Function'>βŠ’</span></code>), and Member of (<code><span class='Function'>∊</span></code>), and also <a href="order.html#bins">Bins</a> (<code><span class='Function'>⍋⍒</span></code>), look through cells of one argument to find cells of the other. Find (<code><span class='Function'>⍷</span></code>) also does a search, but a slightly different one: it tries to find <em>slices</em> of cells of <code><span class='Value'>𝕩</span></code> that match <code><span class='Value'>𝕨</span></code>.</p>
+<p>The <a href="search.html">search functions</a> Index of (<code><span class='Function'>⊐</span></code>), Progressive Index of (<code><span class='Function'>βŠ’</span></code>), and Member of (<code><span class='Function'>∊</span></code>), and also <a href="order.html#bins">Bins</a> (<code><span class='Function'>⍋⍒</span></code>), look through cells of one argument to find cells of the other. <a href="find.html">Find</a> (<code><span class='Function'>⍷</span></code>) also does a search, but a slightly different one: it tries to find <em>slices</em> of cells of <code><span class='Value'>𝕩</span></code> that match <code><span class='Value'>𝕨</span></code>.</p>
<table>
<thead>
<tr>