aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/compose.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/doc/compose.html')
-rw-r--r--docs/doc/compose.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/doc/compose.html b/docs/doc/compose.html
index 7a8da224..eec1877e 100644
--- a/docs/doc/compose.html
+++ b/docs/doc/compose.html
@@ -69,7 +69,7 @@
</g>
</svg>
-<p>Atop and Over are 2-modifiers that extend the idea of &quot;apply this, then that&quot; in two different ways. They're modelled after the mathematical notation f∘g to compose two functions, and both do the same thing when there's one argument: <code><span class='Function'>F</span><span class='Modifier2'>∘</span><span class='Function'>G</span> <span class='Value'>x</span></code> or <code><span class='Function'>F</span><span class='Modifier2'>○</span><span class='Function'>G</span> <span class='Value'>x</span></code> is <code><span class='Function'>F</span> <span class='Function'>G</span> <span class='Value'>x</span></code>.</p>
+<p>Atop and Over are 2-modifiers that extend the idea of &quot;apply this, then that&quot; in two different ways. They're modelled after the mathematical notation f∘g to compose two functions, and both do the same thing when there's one argument: either <code><span class='Function'>F</span><span class='Modifier2'>∘</span><span class='Function'>G</span> <span class='Value'>x</span></code> or <code><span class='Function'>F</span><span class='Modifier2'>○</span><span class='Function'>G</span> <span class='Value'>x</span></code> is <code><span class='Function'>F</span> <span class='Function'>G</span> <span class='Value'>x</span></code>.</p>
<table>
<thead>
<tr>
@@ -99,7 +99,7 @@
</table>
<p>When there are two arguments, we might say Atop treats the right operand <code><span class='Function'>𝔾</span></code> as primary and Over treats <code><span class='Function'>𝔽</span></code> as primary—the primary operand becomes dyadic while the other is always monadic. Atop applies <code><span class='Function'>𝔾</span></code> directly, making it more like mathematical composition if we suppose that <code><span class='Function'>𝔾</span></code> is a function that can take a pair of arguments. Over instead makes two calls to apply <code><span class='Function'>𝔾</span></code> separately to both arguments, then passes the results to <code><span class='Function'>𝔽</span></code>.</p>
<h2 id="atop"><a class="header" href="#atop">Atop</a></h2>
-<p>Of the two modifiers on this page, Atop is more common but less impactful. The composition <code><span class='Function'>F</span><span class='Modifier2'>∘</span><span class='Function'>G</span></code> is equivalent to the 2-<a href="train.html">train</a> <code><span class='Function'>F</span> <span class='Function'>G</span></code> (the trains page has hints on when you'd choose one or the other). Its definition <code><span class='Brace'>{</span><span class='Function'>F</span><span class='Value'>𝕨</span><span class='Function'>G</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code> means that <code><span class='Function'>G</span></code> is applied to one or two arguments and <code><span class='Function'>F</span></code> is applied monadically to the result. It could be considered a &quot;default way&quot; to compose two functions. Keeps <a href="tacit.html">tacit</a> programming syntax running smoothly, without making noise about it. Not like that busybody <code><span class='Modifier2'>⊸</span></code>. Some examples:</p>
+<p>Of the two modifiers on this page, Atop is more common but less impactful. The composition <code><span class='Function'>F</span><span class='Modifier2'>∘</span><span class='Function'>G</span></code> is equivalent to the 2-<a href="train.html">train</a> <code><span class='Function'>F</span> <span class='Function'>G</span></code> (the trains page has hints on when you'd choose one or the other). Its definition <code><span class='Brace'>{</span><span class='Function'>F</span><span class='Value'>𝕨</span><span class='Function'>G</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code> means that <code><span class='Function'>G</span></code> is applied to one or two arguments and <code><span class='Function'>F</span></code> is applied monadically to the result. It's sort of a &quot;default way&quot; to compose two functions. Keeps <a href="tacit.html">tacit</a> programming syntax running smoothly, without making noise about it. Not like that busybody <code><span class='Modifier2'>⊸</span></code>. Some examples:</p>
<p><code><span class='Function'>↕</span><span class='Modifier2'>∘</span><span class='Function'>≠</span></code> is useful with one argument: <code><span class='Function'>↕≠</span><span class='Value'>l</span></code> is a list of indices for <code><span class='Value'>l</span></code>.</p>
<p><code><span class='Function'>⌊</span><span class='Modifier2'>∘</span><span class='Function'>÷</span></code> is useful with two arguments: <code><span class='Function'>⌊</span><span class='Value'>a</span><span class='Function'>÷</span><span class='Value'>b</span></code> is the integer part when dividing <code><span class='Value'>a</span></code> by <code><span class='Value'>b</span></code>, often paired with the <a href="arithmetic.html#additional-arithmetic">remainder</a> <code><span class='Value'>b</span><span class='Function'>|</span><span class='Value'>a</span></code>.</p>
<p><code><span class='Function'>⊔</span><span class='Modifier2'>∘</span><span class='Function'>⊐</span></code> is useful with one or two arguments. From right to left, we have <a href="selfcmp.html#classify">Classify</a>/<a href="search.html#index-of">Index-of</a> (<code><span class='Function'>⊐</span></code>) to convert values to indices, and <a href="group.html">Group Indices</a> to group the indices. Er, that sounds good but what it <em>actually</em> does is to group indices of Group's argument, which correspond to indices of the original <code><span class='Value'>𝕩</span></code>, according to their values as returned by <code><span class='Function'>⊐</span></code>. Without a left argument, this means indices of <code><span class='Value'>𝕩</span></code> are grouped corresponding to <code><span class='Function'>⍷</span><span class='Value'>𝕩</span></code>, and if <code><span class='Value'>𝕨</span></code> is provided the groups correspond to <code><span class='Value'>𝕨</span></code> instead.</p>
@@ -112,7 +112,7 @@
<h2 id="over"><a class="header" href="#over">Over</a></h2>
<p>Once you get used to Over, it's painful to go without it. I'd use it all the time in C if I could.</p>
<p>Usually Over is used just for the dyadic meaning. If you have a composition that only works with one argument it's typical to write it with Atop (<code><span class='Modifier2'>∘</span></code>). And cases that work with one or two arguments do come up from time to time, but they're fairly rare, so the examples below are just for two arguments.</p>
-<p>A classic is the function <code><span class='Function'>≡</span><span class='Modifier2'>○</span><span class='Function'>∧</span></code>, which tests whether <code><span class='Value'>𝕨</span></code> is a reordering of <code><span class='Value'>𝕩</span></code>. The idea is to sort both arrays with <code><span class='Function'>∧</span></code> to remove the ordering information</p>
+<p>A classic is the function <code><span class='Function'>≡</span><span class='Modifier2'>○</span><span class='Function'>∧</span></code>, which tests whether <code><span class='Value'>𝕨</span></code> is a reordering of <code><span class='Value'>𝕩</span></code>. The idea is to sort both arrays with <code><span class='Function'>∧</span></code> to remove the ordering information, then see if they match.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=IkJRTiIg4omh4peL4oinICJRTkIiCiJCUU4iIOKJoeKXi+KIpyAiQkJRIg==">↗️</a><pre> <span class='String'>&quot;BQN&quot;</span> <span class='Function'>≡</span><span class='Modifier2'>○</span><span class='Function'>∧</span> <span class='String'>&quot;QNB&quot;</span>
1
<span class='String'>&quot;BQN&quot;</span> <span class='Function'>≡</span><span class='Modifier2'>○</span><span class='Function'>∧</span> <span class='String'>&quot;BBQ&quot;</span>