aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/tacit.html
blob: 3a2baaefa00b31ca7ed2d1fc016fbc1926058749 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<head>
  <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
  <link href="../style.css" rel="stylesheet"/>
  <title>BQN: Tacit programming</title>
</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="tacit-programming"><a class="header" href="#tacit-programming">Tacit programming</a></h1>
<p><a href="https://aplwiki.com/wiki/Tacit_programming">Tacit programming</a> (or &quot;point-free&quot; in some other languages) is a term for defining functions without referring to arguments directly, which in BQN means programming without <a href="block.html">blocks</a>. Instead, tacit programs are built up by combining smaller functions together; we'll discuss the ways BQN offers to combine functions on this page. Since primitive functions like those returning the left (<code><span class='Function'></span></code>) and right (<code><span class='Function'></span></code>) arguments, and selection functions (<code><span class='Function'>⊏⊑</span></code>), are available as building blocks, tacit programming doesn't keep the programmer from pinpointing a specific part of the input, as the description might lead you to believe. Nonetheless, it has its limitations. In larger tacit programs, moving values to the right place is tedious and error-prone because of the lack of a convenient labelling mechanism, and important context tends to disappear in a sea of symbols.</p>
<p>In smaller amounts—portions of a line—tacit programming can be the clearest way to express an idea, particularly when just one or two variables are used a few times. Consider the following three expressions to filter only the positive values from a list:</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=bCDihpAgMOKAvzXigL/CrzLigL8x4oC/wq8z4oC/wq80CgooMDxsKS9sCnsoMDzwnZWpKS/wnZWpfSBsCjDiirg84oq4LyBs">↗️</a><pre>    <span class='Value'>l</span> <span class='Gets'></span> <span class='Number'>0</span><span class='Ligature'></span><span class='Number'>5</span><span class='Ligature'></span><span class='Number'>¯2</span><span class='Ligature'></span><span class='Number'>1</span><span class='Ligature'></span><span class='Number'>¯3</span><span class='Ligature'></span><span class='Number'>¯4</span>

    <span class='Paren'>(</span><span class='Number'>0</span><span class='Function'>&lt;</span><span class='Value'>l</span><span class='Paren'>)</span><span class='Function'>/</span><span class='Value'>l</span>
⟨ 5 1 ⟩
    <span class='Brace'>{</span><span class='Paren'>(</span><span class='Number'>0</span><span class='Function'>&lt;</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>/</span><span class='Value'>𝕩</span><span class='Brace'>}</span> <span class='Value'>l</span>
⟨ 5 1 ⟩
    <span class='Number'>0</span><span class='Modifier2'></span><span class='Function'>&lt;</span><span class='Modifier2'></span><span class='Function'>/</span> <span class='Value'>l</span>
⟨ 5 1 ⟩
</pre>
<p>The first of these expressions is the most direct, but with the variable name buried inside, it can't be used on an intermediate value—its input will have to be named. The other two forms stand alone as functions, so they can easily be placed anywhere in a program, even as an operand. But with even the small amount of structure added by a BQN anonymous function, the second method has more organization than action! The third, tacit, version strips away most of the organizing syntax to leave us with the essential pieces <code><span class='Number'>0</span></code>, <code><span class='Function'>&lt;</span></code>, and <code><span class='Function'>/</span></code> joined by combinators. The explicit function uses <code><span class='Value'>𝕩</span></code> as a sort of pronoun (&quot;I want the elements of it where it's greater than zero&quot;), while the tacit one elides it (&quot;give me the elements greater than zero&quot;).</p>
<p>The ability to easily combine tacit and &quot;explicit&quot; programming in blocks isn't only a way to mitigate the disadvantages of these two methods, but brings new advantages that no single paradigm could accomplish. Purely tacit programming <em>requires</em> programs to use <em>no</em> named local variables, but partly tacit programming <em>allows</em> them to use <em>fewer</em> names. That means names can be used only for the parts of a program that represent clean, human-understandable concepts. Another possible strategic choice is to use the fact that variables in a tacit expression are expanded as it's formed but those inside a block aren't. So <code><span class='Function'>F</span><span class='Gets'></span><span class='Value'>a</span><span class='Modifier2'></span><span class='Function'>+</span></code> can be chosen to &quot;freeze&quot; the value of <code><span class='Value'>a</span></code> in <code><span class='Function'>F</span></code> without having to use an extra variable, while <code><span class='Function'>F</span><span class='Gets'></span><span class='Brace'>{</span><span class='Value'>a</span><span class='Function'>+</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code> uses the current value of <code><span class='Value'>a</span></code> each time <code><span class='Function'>F</span></code> is called.</p>
<p>The rest of this page describes BQN's tacit programming facilities. Deciding when to use them is a matter of taste, and experience.</p>
<h2 id="trains"><a class="header" href="#trains">Trains</a></h2>
<p>In modern APL and its relatives, the backbone of tacit infrastructure is the <em>function train</em>. Trains can take some practice to understand and use well, so they're described in more depth on <a href="train.html">a dedicated page</a>. The idea of trains is that you can &quot;apply&quot; a function to other functions, forming a composed function where it will actually apply to their results. So a typical use is to <a href="pair.html">pair</a> two functions as shown below: the pair <code><span class='Function'>»</span><span class='Ligature'></span><span class='Function'>«</span></code> is never formed, but the result of applying <code><span class='Function'>T</span></code> is a pair.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=VCDihpAgwrsg4ouIIMKrICAgICMgUGFpciBib3RoIHNoaWZ0IGZ1bmN0aW9ucwpUICAgICAgICAgICAgIyBOb3RoaW5nIGhhcHBlbnMgeWV0Li4uCgpUICJhYmMiICAgICAgIyBOb3cgaXQgZm9ybXMgYSBwYWlyCgonWCcgVCAiYWJjIiAgIyBFYWNoIHNoaWZ0IGdldHMgYm90aCBhcmd1bWVudHM=">↗️</a><pre>    <span class='Function'>T</span> <span class='Gets'></span> <span class='Function'>»</span> <span class='Function'></span> <span class='Function'>«</span>    <span class='Comment'># Pair both shift functions
</span>    <span class='Function'>T</span>            <span class='Comment'># Nothing happens yet...
</span>»⋈«

    <span class='Function'>T</span> <span class='String'>&quot;abc&quot;</span>      <span class='Comment'># Now it forms a pair
</span>⟨ " ab" "bc " ⟩

    <span class='String'>'X'</span> <span class='Function'>T</span> <span class='String'>&quot;abc&quot;</span>  <span class='Comment'># Each shift gets both arguments
</span>⟨ "Xab" "bcX" ⟩
</pre>
<h2 id="identity-functions"><a class="header" href="#identity-functions">Identity functions</a></h2>
<p>If you use trains even a little you'll quickly find the need to get an argument without applying any function to it. Take the pattern <code><span class='Brace'>{</span><span class='Paren'>(</span><span class='Value'>𝕨</span><span class='Function'>F</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>G</span><span class='Value'>𝕨</span><span class='Brace'>}</span></code> for example. You might expect <code><span class='Modifier2'>⊸⟜</span></code> (discussed below) to handle this, but they don't: in those combinators, the first function to be applied always has one argument, but <code><span class='Function'>F</span></code> here has two. Instead, a good way to fit this into a tacit form is to note that <code><span class='Value'>𝕨</span><span class='Function'></span><span class='Value'>𝕩</span></code> is defined to be <code><span class='Value'>𝕨</span></code>, and substitute backwards to give <code><span class='Brace'>{</span><span class='Paren'>(</span><span class='Value'>𝕨</span><span class='Function'>F</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>G</span><span class='Paren'>(</span><span class='Value'>𝕨</span><span class='Function'></span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Brace'>}</span></code>, which now has the form of a train <code><span class='Function'>F</span> <span class='Function'>G</span> <span class='Function'></span></code>.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=IndoYXRzaW4iIHso8J2VqOKIivCdlakpL/Cdlah9ICJpbnRlcnNlY3QiCgoid2hhdHNpbiIgKOKIii/iiqMpICJpbnRlcnNlY3Qi">↗️</a><pre>    <span class='String'>&quot;whatsin&quot;</span> <span class='Brace'>{</span><span class='Paren'>(</span><span class='Value'>𝕨</span><span class='Function'></span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>/</span><span class='Value'>𝕨</span><span class='Brace'>}</span> <span class='String'>&quot;intersect&quot;</span>
"tsin"

    <span class='String'>&quot;whatsin&quot;</span> <span class='Paren'>(</span><span class='Function'>∊/⊣</span><span class='Paren'>)</span> <span class='String'>&quot;intersect&quot;</span>
"tsin"
</pre>
<p>The functions <code><span class='Function'>⊣⊢</span></code> are as simple as they come, but are discussed quite a bit on <a href="identity.html">their own page</a>. A definition is that <code><span class='Function'></span></code> is <code><span class='Brace'>{</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code> and <code><span class='Function'></span></code> is <code><span class='Brace'>{</span><span class='Value'>𝕩</span><span class='Head'>;</span><span class='Value'>𝕨</span><span class='Brace'>}</span></code>, so that <code><span class='Function'></span></code> returns its right argument, and <code><span class='Function'></span></code> returns its left argument but will settle for the right one if there's just one.</p>
<h2 id="combinators"><a class="header" href="#combinators">Combinators</a></h2>
<p>Here's a table of all the typical tacit combinators for reference. The yellow lines show which values are passed to functions in order to evaluate each combinator: we start with values <code><span class='Value'>𝕩</span></code> and maybe <code><span class='Value'>𝕨</span></code> at the bottom, and the result is the single value that comes out at the top, after applying the functions.</p>
<svg viewBox='0 0 850 530'>
  <g font-size='20px' text-anchor='middle' transform='translate(145,20)'>
    <rect class='code' stroke-width='1' rx='12' x='-120.4' y='1' width='240.8' height='205'/>
    <text dy='0.32em' y='223' fill='currentColor'>Atop</text>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(-60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Function'>𝔽</tspan><tspan class='Modifier2'></tspan><tspan class='Function'>𝔾</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L0 57'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 57L0 114'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='0'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='114'/>
      <text dy='0.32em' x='0' y='0'><tspan class='Function'>𝔽</tspan></text>
      <text dy='0.32em' x='0' y='57'><tspan class='Function'>𝔾</tspan></text>
      <text dy='0.32em' x='0' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Value'>𝕨</tspan> <tspan class='Function'>𝔽</tspan><tspan class='Modifier2'></tspan><tspan class='Function'>𝔾</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L0 57'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 57L-32 114'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 57L32 114'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='0'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='-32' cy='114'/>
      <circle r='12' class='code' stroke-width='0' cx='32' cy='114'/>
      <text dy='0.32em' x='0' y='0'><tspan class='Function'>𝔽</tspan></text>
      <text dy='0.32em' x='0' y='57'><tspan class='Function'>𝔾</tspan></text>
      <text dy='0.32em' x='-32' y='114'><tspan class='Value'>𝕨</tspan></text>
      <text dy='0.32em' x='32' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
  </g>
  <g font-size='20px' text-anchor='middle' transform='translate(425,20)'>
    <rect class='code' stroke-width='1' rx='12' x='-120.4' y='1' width='240.8' height='205'/>
    <text dy='0.32em' y='223' fill='currentColor'>Over</text>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(-60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Function'>𝔽</tspan><tspan class='Modifier2'></tspan><tspan class='Function'>𝔾</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L0 57'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 57L0 114'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='0'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='114'/>
      <text dy='0.32em' x='0' y='0'><tspan class='Function'>𝔽</tspan></text>
      <text dy='0.32em' x='0' y='57'><tspan class='Function'>𝔾</tspan></text>
      <text dy='0.32em' x='0' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Value'>𝕨</tspan> <tspan class='Function'>𝔽</tspan><tspan class='Modifier2'></tspan><tspan class='Function'>𝔾</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L-32 57'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M-32 57L-32 114'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L32 57'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M32 57L32 114'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='0'/>
      <circle r='12' class='code' stroke-width='0' cx='-32' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='32' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='-32' cy='114'/>
      <circle r='12' class='code' stroke-width='0' cx='32' cy='114'/>
      <text dy='0.32em' x='0' y='0'><tspan class='Function'>𝔽</tspan></text>
      <text dy='0.32em' x='-32' y='57'><tspan class='Function'>𝔾</tspan></text>
      <text dy='0.32em' x='32' y='57'><tspan class='Function'>𝔾</tspan></text>
      <text dy='0.32em' x='-32' y='114'><tspan class='Value'>𝕨</tspan></text>
      <text dy='0.32em' x='32' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
  </g>
  <g font-size='20px' text-anchor='middle' transform='translate(705,20)'>
    <rect class='code' stroke-width='1' rx='12' x='-120.4' y='1' width='240.8' height='205'/>
    <text dy='0.32em' y='223' fill='currentColor'>Constant</text>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(-60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Value'>𝕗</tspan><tspan class='Modifier'>˙</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L0 57'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='114'/>
      <text dy='0.32em' x='0' y='57'><tspan class='Value'>𝕗</tspan></text>
      <text dy='0.32em' x='0' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Value'>𝕨</tspan> <tspan class='Value'>𝕗</tspan><tspan class='Modifier'>˙</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L0 57'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='-32' cy='114'/>
      <circle r='12' class='code' stroke-width='0' cx='32' cy='114'/>
      <text dy='0.32em' x='0' y='57'><tspan class='Value'>𝕗</tspan></text>
      <text dy='0.32em' x='-32' y='114'><tspan class='Value'>𝕨</tspan></text>
      <text dy='0.32em' x='32' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
  </g>
  <g font-size='20px' text-anchor='middle' transform='translate(145,280)'>
    <rect class='code' stroke-width='1' rx='12' x='-120.4' y='1' width='240.8' height='205'/>
    <text dy='0.32em' y='223' fill='currentColor'>Before</text>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(-60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Function'>𝔽</tspan><tspan class='Modifier2'></tspan><tspan class='Function'>𝔾</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L-32 57'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M-32 57L0 114'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0Q41.6 57 0 114'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='0'/>
      <circle r='12' class='code' stroke-width='0' cx='-32' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='114'/>
      <text dy='0.32em' x='0' y='0'><tspan class='Function'>𝔾</tspan></text>
      <text dy='0.32em' x='-32' y='57'><tspan class='Function'>𝔽</tspan></text>
      <text dy='0.32em' x='0' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Value'>𝕨</tspan> <tspan class='Function'>𝔽</tspan><tspan class='Modifier2'></tspan><tspan class='Function'>𝔾</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L-32 57'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M-32 57L-32 114'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0C40 57 32 51.3 32 114'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='0'/>
      <circle r='12' class='code' stroke-width='0' cx='-32' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='-32' cy='114'/>
      <circle r='12' class='code' stroke-width='0' cx='32' cy='114'/>
      <text dy='0.32em' x='0' y='0'><tspan class='Function'>𝔾</tspan></text>
      <text dy='0.32em' x='-32' y='57'><tspan class='Function'>𝔽</tspan></text>
      <text dy='0.32em' x='-32' y='114'><tspan class='Value'>𝕨</tspan></text>
      <text dy='0.32em' x='32' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
  </g>
  <g font-size='20px' text-anchor='middle' transform='translate(425,280)'>
    <rect class='code' stroke-width='1' rx='12' x='-120.4' y='1' width='240.8' height='205'/>
    <text dy='0.32em' y='223' fill='currentColor'>After</text>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(-60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Function'>𝔽</tspan><tspan class='Modifier2'></tspan><tspan class='Function'>𝔾</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0Q-41.6 57 0 114'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L32 57'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M32 57L0 114'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='0'/>
      <circle r='12' class='code' stroke-width='0' cx='32' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='114'/>
      <text dy='0.32em' x='0' y='0'><tspan class='Function'>𝔽</tspan></text>
      <text dy='0.32em' x='32' y='57'><tspan class='Function'>𝔾</tspan></text>
      <text dy='0.32em' x='0' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Value'>𝕨</tspan> <tspan class='Function'>𝔽</tspan><tspan class='Modifier2'></tspan><tspan class='Function'>𝔾</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0C-40 57 -32 51.3 -32 114'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0L32 57'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M32 57L32 114'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='0'/>
      <circle r='12' class='code' stroke-width='0' cx='32' cy='57'/>
      <circle r='12' class='code' stroke-width='0' cx='-32' cy='114'/>
      <circle r='12' class='code' stroke-width='0' cx='32' cy='114'/>
      <text dy='0.32em' x='0' y='0'><tspan class='Function'>𝔽</tspan></text>
      <text dy='0.32em' x='32' y='57'><tspan class='Function'>𝔾</tspan></text>
      <text dy='0.32em' x='-32' y='114'><tspan class='Value'>𝕨</tspan></text>
      <text dy='0.32em' x='32' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
  </g>
  <g font-size='20px' text-anchor='middle' transform='translate(705,280)'>
    <rect class='code' stroke-width='1' rx='12' x='-120.4' y='1' width='240.8' height='205'/>
    <text dy='0.32em' y='223' fill='currentColor'>Self/Swap</text>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(-60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Function'>𝔽</tspan><tspan class='Modifier'>˜</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0Q-41.6 57 0 114'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0Q41.6 57 0 114'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='0'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='114'/>
      <text dy='0.32em' x='0' y='0'><tspan class='Function'>𝔽</tspan></text>
      <text dy='0.32em' x='0' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
    <g font-size='21px' font-family='BQN,monospace' transform='translate(60.87,25)'>
      <text dy='0.32em' y='155' font-size='19px'><tspan class='Value'>𝕨</tspan> <tspan class='Function'>𝔽</tspan><tspan class='Modifier'>˜</tspan> <tspan class='Value'>𝕩</tspan></text>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0C-40 28.5 0 57 32 114'/>
      <path class='yellow' style='fill:none' stroke-width='2' d='M0 0C40 28.5 0 57 -32 114'/>
      <circle r='12' class='code' stroke-width='0' cx='0' cy='0'/>
      <circle r='12' class='code' stroke-width='0' cx='-32' cy='114'/>
      <circle r='12' class='code' stroke-width='0' cx='32' cy='114'/>
      <text dy='0.32em' x='0' y='0'><tspan class='Function'>𝔽</tspan></text>
      <text dy='0.32em' x='-32' y='114'><tspan class='Value'>𝕨</tspan></text>
      <text dy='0.32em' x='32' y='114'><tspan class='Value'>𝕩</tspan></text>
    </g>
  </g>
</svg>

<p>Each of these combinators has its role to play in tacit code. To start with, <a href="constant.html">Constant</a> (<code><span class='Modifier'>˙</span></code>) is the subtlest one, because it's used everywhere, in a sense, but rarely needs to be made explicit. This is because data values already behave like constant functions. For example, the train <code><span class='Number'>4</span><span class='Function'></span></code> might more precisely be written <code><span class='Number'>4</span><span class='Modifier'>˙</span><span class='Function'></span></code>, but trains conveniently handle this part already. However, it <em>is</em> often used at the end of a train, to force the last part into a function role. <code><span class='Function'>×-</span><span class='Number'>1</span></code> isn't a train—it just evaluates to ¯1. But <code><span class='Function'>×-</span><span class='Number'>1</span><span class='Modifier'>˙</span></code> is the train that multiplies its arguments and subtracts 1.</p>
<p>Using <a href="swap.html">Self and Swap</a> is pretty straightforward. Swap in particular is often useful if your arguments happen to be the wrong way around. For example, <code><span class='Function'></span><span class='Modifier2'></span><span class='Function'>÷</span><span class='Modifier'>˜</span><span class='Function'>⋈|</span></code> gives you the integer part and remainder when dividing <code><span class='Value'>𝕨</span></code> by <code><span class='Value'>𝕩</span></code>. For compatibility with math, <code><span class='Function'>÷</span></code> is &quot;backwards&quot; from a BQN perspective, but <code><span class='Modifier'>˜</span></code> will fix that right up. And while we're at it, let's note that <a href="compose.html#atop">Atop</a> is just another way to write a 2-train, so that <code><span class='Function'></span><span class='Modifier2'></span><span class='Function'>÷</span><span class='Modifier'>˜</span></code> is <code><span class='Paren'>(</span><span class='Function'>⌊÷</span><span class='Paren'>)</span><span class='Modifier'>˜</span></code> but avoids the parentheses.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MyAo4oyK4oiYw7fLnOKLiHwpIDEzICAjIDEzID0gMSszw5c0">↗️</a><pre>    <span class='Number'>3</span> <span class='Paren'>(</span><span class='Function'></span><span class='Modifier2'></span><span class='Function'>÷</span><span class='Modifier'>˜</span><span class='Function'>⋈|</span><span class='Paren'>)</span> <span class='Number'>13</span>  <span class='Comment'># 13 = 1+3×4
</span>⟨ 4 1 ⟩
</pre>
<p><a href="hook.html">Before and After</a> are tacit powerhouses. Yes, <code><span class='Function'>F</span><span class='Modifier2'></span><span class='Function'>G</span></code> is just <code><span class='Function'>F</span><span class='Modifier2'></span><span class='Function'>⊣G⊢</span></code> and <code><span class='Function'>G</span><span class='Modifier2'></span><span class='Function'>F</span></code> is <code><span class='Function'>⊣G</span> <span class='Function'>F</span><span class='Modifier2'></span><span class='Function'></span></code>. But the symmetric symbols make these cases a lot easier to read and manipulate as a programmer (just remember, pointy-side function is applied first!). It's common to write big tacit functions with the pattern <code><span class='Paren'>(</span><span class='Value'></span><span class='Paren'>)</span><span class='Modifier2'></span><span class='Function'>Fn</span> <span class='Value'>𝕩</span></code>, so a lot of processing is applied to <code><span class='Value'>𝕩</span></code> and then the result of this is passed along with <code><span class='Value'>𝕩</span></code> to <code><span class='Function'>Fn</span></code>. And of course binds like <code><span class='Function'>÷</span><span class='Modifier2'></span><span class='Number'>2</span></code>, dividing by 2, or <code><span class='Number'>¯1</span><span class='Modifier2'></span><span class='Function'>»</span></code>, shifting in a ¯1, are very often helpful.</p>
<p><a href="compose.html#over">Over</a> is a bit weirder, and you'll have to learn when to recognize this pattern (of course, a repeated function is a strong hint). Perhaps you'd compare the first element of two lists with <code><span class='Function'></span><span class='Modifier2'></span><span class='Function'></span></code>, for example.</p>
<h2 id="conditionals"><a class="header" href="#conditionals">Conditionals</a></h2>
<p>There are two main ways to perform conditional logic in tacit code. Although, a note first: for arithmetic, array operations that use booleans as numbers can often fill in for conditionals, and they're a lot faster. So, to replace every space character with a hyphen, try this function that multiplies the difference between those characters by a mask that's 1 where <code><span class='Value'>𝕩</span></code> is a space, then subtracts that back from <code><span class='Value'>𝕩</span></code>.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=IiAtIiAo4oqiLS3CtOKImOKKo8OX4oqR4oq4PSkgImFiIGNkZSAgZiAi">↗️</a><pre>    <span class='String'>&quot; -&quot;</span> <span class='Paren'>(</span><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='Paren'>)</span> <span class='String'>&quot;ab cde  f &quot;</span>
"ab-cde--f-"
</pre>
<p>The <a href="repeat.html">Repeat</a> (<code><span class='Modifier2'></span></code>) modifier makes a nice &quot;if&quot; conditional. <code><span class='Function'>F</span><span class='Modifier2'></span><span class='Function'>G</span></code>, assuming the result of <code><span class='Function'>G</span></code> is a boolean, is equivalent to <code><span class='Brace'>{</span><span class='Value'>𝕨</span><span class='Function'>G</span><span class='Value'>𝕩</span><span class='Head'>?</span><span class='Value'>𝕨</span><span class='Function'>F</span><span class='Value'>𝕩</span><span class='Head'>;</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code>. Note how <code><span class='Value'>𝕨</span></code> gets passed in to both functions. Often you'll want <code><span class='Function'>𝔽</span></code> to apply to <code><span class='Value'>𝕩</span></code> only, and in this case, you need to make this explicit with <code><span class='Function'></span></code> or similar.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MyAoMsO3y5ziiqIp4o2fPCA3ICAjIGhhbHZlIPCdlakgaWYgZ3JlYXRlciB0aGFuIPCdlag=">↗️</a><pre>    <span class='Number'>3</span> <span class='Paren'>(</span><span class='Number'>2</span><span class='Function'>÷</span><span class='Modifier'>˜</span><span class='Function'></span><span class='Paren'>)</span><span class='Modifier2'></span><span class='Function'>&lt;</span> <span class='Number'>7</span>  <span class='Comment'># halve 𝕩 if greater than 𝕨
</span>3.5
</pre>
<p>For more complicated &quot;if-else&quot; or &quot;select&quot; type conditionals, use <a href="choose.html">Choose</a> (<code><span class='Modifier2'></span></code>). Watch for ordering here: <code><span class='Function'>F</span><span class='Modifier2'></span><span class='Bracket'></span><span class='Function'>G0</span><span class='Separator'>,</span><span class='Function'>G1</span><span class='Bracket'></span></code> puts the two parts in the opposite order to Repeat, and list element 1 comes after element 0 even though it might seem more intuitive for the &quot;true&quot; value to come first.</p>
<h2 id="valences"><a class="header" href="#valences">Valences</a></h2>
<p>An ambivalent function is one that can take one or two arguments. Tacit code has a hot-and-cold kind of relationship with it. In cases that fit well with Atop, Over, and trains, it tends to work very well. In others, it might <a href="../commentary/problems.html#cant-always-transfer-ambivalence-in-tacit-code">not work</a> at all. An example is the <code><span class='Brace'>{</span><span class='Value'>𝕨</span><span class='Function'>𝔽𝔾</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code> combinator: there's just no tacit equivalent. However, any ambivalent <em>function</em> can still be represented, because <a href="valences.html">Valences</a> (<code><span class='Modifier2'></span></code>) combines a separate monadic and dyadic case.</p>
<p>When designing complex ambivalent functions, it's often best to mix tacit programming with blocks. I usually think of the block as the base for this, since <code><span class='Value'>𝕨</span></code> tends to work with, and might put small tacit functions like <code><span class='Function'></span><span class='Modifier2'></span><span class='Function'></span></code> inside, or tack on shared functionality such as <code><span class='Function'></span><span class='Modifier2'></span><span class='Value'></span></code> on the outside.</p>
<h2 id="example-combinations"><a class="header" href="#example-combinations">Example: combinations</a></h2>
<p>As an example, we'll look at the following <a href="https://en.wikipedia.org/wiki/Binomial_coefficient">combinations function</a> implementation from bqncrate (substituting the conventional <code><span class='Value'>k</span></code> and <code><span class='Value'>n</span></code> in for <code><span class='Value'>i0</span></code> and <code><span class='Value'>j0</span></code>):</p>
<pre><span class='Value'>k</span><span class='Paren'>(</span><span class='Function'></span><span class='Modifier2'></span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Paren'>)</span><span class='Number'>1</span><span class='Modifier2'></span><span class='Function'>+</span><span class='Paren'>)</span><span class='Modifier2'></span><span class='Function'></span><span class='Modifier'>˜</span><span class='Value'>n</span>  <span class='Comment'># Number of unordered selections (combinations) of k items from n choices
</span></pre>
<p>This function takes the typical approach of multiplying numbers that start at <code><span class='Value'>n</span></code> and go down, and dividing by numbers starting at <code><span class='Number'>1</span></code> and going up. It's easier to understand from the BQN code, really:</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=buKGkDUg4ouEIGvihpAzCgrin6huLeKGlWssIDEr4oaVa+KfqQoKKMOXwrRuLeKGlWspIMO3ICjDl8K0MSvihpVrKQ==">↗️</a><pre>    <span class='Value'>n</span><span class='Gets'></span><span class='Number'>5</span> <span class='Separator'></span> <span class='Value'>k</span><span class='Gets'></span><span class='Number'>3</span>

    <span class='Bracket'></span><span class='Value'>n</span><span class='Function'>-↕</span><span class='Value'>k</span><span class='Separator'>,</span> <span class='Number'>1</span><span class='Function'>+↕</span><span class='Value'>k</span><span class='Bracket'></span>
⟨ ⟨ 5 4 3 ⟩ ⟨ 1 2 3 ⟩ ⟩

    <span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Value'>n</span><span class='Function'>-↕</span><span class='Value'>k</span><span class='Paren'>)</span> <span class='Function'>÷</span> <span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Function'>+↕</span><span class='Value'>k</span><span class='Paren'>)</span>
10
</pre>
<p>(The <code><span class='Number'>3</span></code> can be eliminated by replacing <code><span class='Value'>k</span></code> with <code><span class='Value'>k</span><span class='Function'></span><span class='Value'>n</span><span class='Function'>-</span><span class='Value'>k</span></code>. Figuring out how to do that can be a tacit exercise for later?)</p>
<p>This says there are 10 ways to choose 3 out of 5 different options. Of course it's easy enough to make it into a function of <code><span class='Value'>k</span></code> and <code><span class='Value'>n</span></code>:</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=buKGkDUg4ouEIGvihpAzCmsgeyjDl8K08J2VqS3ihpXwnZWoKcO3w5fCtDEr4oaV8J2VqH0gbg==">↗️</a><pre>    <span class='Value'>k</span> <span class='Brace'>{</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Value'>𝕩</span><span class='Function'>-↕</span><span class='Value'>𝕨</span><span class='Paren'>)</span><span class='Function'>÷×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Function'>+↕</span><span class='Value'>𝕨</span><span class='Brace'>}</span> <span class='Value'>n</span>
10
</pre>
<p>But we are on the tacit page, so we'd like to make it tacit. For better or for worse. There's a mechanical way to do this for many functions, using only identity functions and trains, and making no simplifications. First parenthesize all monadic function calls, as these will become 2-trains. Then replace <code><span class='Value'>𝕨</span></code> and <code><span class='Value'>𝕩</span></code> with <code><span class='Function'></span></code> and <code><span class='Function'></span></code>, and add a <code><span class='Modifier'>˙</span></code> to constants. For the number <code><span class='Number'>1</span></code> the added <code><span class='Modifier'>˙</span></code> isn't necessary unless it comes at the end of a train, but we include it here to show the principle.</p>
<pre><span class='Brace'>{</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Value'>𝕩</span><span class='Function'>-↕</span><span class='Value'>𝕨</span><span class='Paren'>)</span><span class='Function'>÷×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Function'>+↕</span><span class='Value'>𝕨</span><span class='Brace'>}</span>

<span class='Brace'>{</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Value'>𝕩</span><span class='Function'>-</span><span class='Paren'>(</span><span class='Function'></span><span class='Value'>𝕨</span><span class='Paren'>))</span><span class='Function'>÷</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Function'>+</span><span class='Paren'>(</span><span class='Function'></span><span class='Value'>𝕨</span><span class='Paren'>))</span><span class='Brace'>}</span>  <span class='Comment'># Parenthesize monadic functions
</span>
 <span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Function'>⊢-</span><span class='Paren'>(</span><span class='Function'>↕⊣</span><span class='Paren'>))</span><span class='Function'>÷</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Modifier'>˙</span><span class='Function'>+</span><span class='Paren'>(</span><span class='Function'>↕⊣</span><span class='Paren'>))</span>   <span class='Comment'># 𝕨 to ⊣ and 𝕩 to ⊢
</span></pre>
<p>It's not pretty, but does give the same result.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=buKGkDUg4ouEIGvihpAzCmsgKCjDl8K04oqiLSjihpXiiqMpKcO3KMOXwrQxy5krKOKGleKKoykpKSBu">↗️</a><pre>    <span class='Value'>k</span> <span class='Paren'>((</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Function'>⊢-</span><span class='Paren'>(</span><span class='Function'>↕⊣</span><span class='Paren'>))</span><span class='Function'>÷</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Modifier'>˙</span><span class='Function'>+</span><span class='Paren'>(</span><span class='Function'>↕⊣</span><span class='Paren'>)))</span> <span class='Value'>n</span>
10
</pre>
<p>This misses entirely the draw of tacit programming for this example, which is that it allows us to combine the repeated <code><span class='Function'></span></code> and <code><span class='Function'>×</span><span class='Modifier'>´</span></code> functions—not that we can't do it in a block function, but it turns out to be more natural in tacit code. Here's a list of transformations that turn the block into <em>nice</em> tacit code, not just any tacit code.</p>
<pre><span class='Brace'>{</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Value'>𝕩</span><span class='Function'>-↕</span><span class='Value'>𝕨</span><span class='Paren'>)</span><span class='Function'>÷×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Function'>+↕</span><span class='Value'>𝕨</span><span class='Brace'>}</span>

<span class='Function'></span><span class='Modifier2'></span><span class='Brace'>{</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Value'>𝕩</span><span class='Function'>-</span><span class='Value'>𝕨</span><span class='Paren'>)</span><span class='Function'>÷×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Function'>+</span><span class='Value'>𝕨</span><span class='Brace'>}</span>   <span class='Comment'># The ↕ is applied to every instance of 𝕨
</span>
<span class='Function'></span><span class='Modifier2'></span><span class='Paren'>((</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Function'>⊢-⊣</span><span class='Paren'>)</span><span class='Function'>÷</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Function'>+⊣</span><span class='Paren'>))</span> <span class='Comment'># Mechanically transform to tacit
</span>
<span class='Function'></span><span class='Modifier2'></span><span class='Paren'>((</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Function'>-</span><span class='Modifier'>˜</span><span class='Paren'>)</span><span class='Function'>÷</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Function'>+⊣</span><span class='Paren'>))</span>  <span class='Comment'># ⊢-⊣ is -˜
</span>
<span class='Function'></span><span class='Modifier2'></span><span class='Paren'>(</span><span class='Function'>-</span><span class='Modifier'>˜</span><span class='Function'>÷</span><span class='Modifier2'></span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Paren'>)</span><span class='Number'>1</span><span class='Function'>+⊣</span><span class='Paren'>)</span>     <span class='Comment'># Both arguments to ÷ have ×´ applied
</span>
<span class='Paren'>(</span><span class='Function'></span><span class='Modifier2'></span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Paren'>)</span><span class='Number'>1</span><span class='Function'>+⊢</span><span class='Paren'>)</span><span class='Modifier2'></span><span class='Function'></span><span class='Modifier'>˜</span>     <span class='Comment'># Move ˜ to the outside
</span></pre>
<p>The bqncrate version changes <code><span class='Number'>1</span><span class='Function'>+⊢</span></code> to <code><span class='Number'>1</span><span class='Modifier2'></span><span class='Function'>+</span></code>, but otherwise matches the final line. As you can see, there are a few slightly different ways to write this function. This is a common situation. You might choose one version based on personal style, or which parts of the function you want to emphasize.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=buKGkDUg4ouEIGvihpAzCmsgKC3Dt+KXiyjDl8K0KTHiirgrKeKfnOKGlcucIG4=">↗️</a><pre>    <span class='Value'>k</span> <span class='Paren'>(</span><span class='Function'></span><span class='Modifier2'></span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Paren'>)</span><span class='Number'>1</span><span class='Modifier2'></span><span class='Function'>+</span><span class='Paren'>)</span><span class='Modifier2'></span><span class='Function'></span><span class='Modifier'>˜</span> <span class='Value'>n</span>
10
</pre>
<p>A side effect of moving to tacit code is that the function is now defined in the monadic case, where it gave an error previously. It copies the left argument over to the right, and the number of ways to choose <code><span class='Value'>n</span></code> items out of <code><span class='Value'>n</span></code> is always <code><span class='Number'>1</span></code>, so this is a pretty useless addition.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=eyjDl8K08J2VqS3ihpXwnZWoKcO3w5fCtDEr4oaV8J2VqH0gMTAKCigtw7fil4sow5fCtCkx4oq4Kynin5zihpXLnCAxMA==">↗️</a><pre>    <span class='Brace'>{</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Value'>𝕩</span><span class='Function'>-↕</span><span class='Value'>𝕨</span><span class='Paren'>)</span><span class='Function'>÷×</span><span class='Modifier'>´</span><span class='Number'>1</span><span class='Function'>+↕</span><span class='Value'>𝕨</span><span class='Brace'>}</span> <span class='Number'>10</span>
<span class='Error'>Error: This block cannot be called monadically</span>

    <span class='Paren'>(</span><span class='Function'></span><span class='Modifier2'></span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>´</span><span class='Paren'>)</span><span class='Number'>1</span><span class='Modifier2'></span><span class='Function'>+</span><span class='Paren'>)</span><span class='Modifier2'></span><span class='Function'></span><span class='Modifier'>˜</span> <span class='Number'>10</span>
1
</pre>
<p>But it can confuse the reader, who might try to work out what the monadic case does before realizing this. So it's good practice to make sure the context indicates how many arguments a tacit function takes, because the function itself doesn't tell. This is also a reason to move to blocks with headers as functions get larger.</p>