aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/primitive.html
blob: e943a23c74a80c1fd849175980425b40a493460b (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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
<head>
  <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
  <link href="../style.css" rel="stylesheet"/>
  <title>BQN primitives</title>
</head>
<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div>
<h1 id="bqn-primitives">BQN primitives</h1>
<p><em>Primitives</em> are functions and modifiers that are built into the language.</p>
<h2 id="functions">Functions</h2>
<p>Functions that have significant differences from APL functions are marked with an asterisk. Links for these entries go to dedicated BQN documentation while other links go to the APL Wiki.</p>
<table>
<thead>
<tr>
<th>Glyph</th>
<th>Monadic</th>
<th>Dyadic</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><span class='Function'>+</span></code></td>
<td><a href="https://aplwiki.com/wiki/Conjugate">Conjugate</a></td>
<td><a href="https://aplwiki.com/wiki/Add">Add</a></td>
</tr>
<tr>
<td><code><span class='Function'>-</span></code></td>
<td><a href="https://aplwiki.com/wiki/Negate">Negate</a></td>
<td><a href="https://aplwiki.com/wiki/Subtract">Subtract</a></td>
</tr>
<tr>
<td><code><span class='Function'>×</span></code></td>
<td><a href="https://aplwiki.com/wiki/Signum">Sign</a></td>
<td><a href="https://aplwiki.com/wiki/Times">Multiply</a></td>
</tr>
<tr>
<td><code><span class='Function'>÷</span></code></td>
<td><a href="https://aplwiki.com/wiki/Reciprocal">Reciprocal</a></td>
<td><a href="https://aplwiki.com/wiki/Divide">Divide</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Exponential">Exponential</a></td>
<td><a href="https://aplwiki.com/wiki/Power_(function)">Power</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Square_Root">Square Root</a></td>
<td><a href="https://aplwiki.com/wiki/Root">Root</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Floor">Floor</a></td>
<td><a href="https://aplwiki.com/wiki/Minimum">Minimum</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Ceiling">Ceiling</a></td>
<td><a href="https://aplwiki.com/wiki/Maximum">Maximum</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td>Sort Up</td>
<td><a href="logic.html">And</a>*</td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td>Sort Down</td>
<td><a href="logic.html">Or</a>*</td>
</tr>
<tr>
<td><code><span class='Function'>¬</span></code></td>
<td><a href="logic.html">Not</a>*</td>
<td><a href="logic.html">Span</a>*</td>
</tr>
<tr>
<td><code><span class='Function'>|</span></code></td>
<td><a href="https://aplwiki.com/wiki/Magnitude">Absolute Value</a></td>
<td><a href="https://aplwiki.com/wiki/Residue">Modulus</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td></td>
<td><a href="https://aplwiki.com/wiki/Less_than_or_Equal_to">Less Than or Equal to</a></td>
</tr>
<tr>
<td><code><span class='Function'>&lt;</span></code></td>
<td><a href="https://aplwiki.com/wiki/Enclose">Enclose</a></td>
<td><a href="https://aplwiki.com/wiki/Less_than">Less Than</a></td>
</tr>
<tr>
<td><code><span class='Function'>&gt;</span></code></td>
<td><a href="couple.html">Merge</a>*</td>
<td><a href="https://aplwiki.com/wiki/Greater_than">Greater Than</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td></td>
<td><a href="https://aplwiki.com/wiki/Greater_than_or_Equal_to">Greater Than or Equal to</a></td>
</tr>
<tr>
<td><code><span class='Function'>=</span></code></td>
<td>Rank</td>
<td><a href="https://aplwiki.com/wiki/Equal_to">Equals</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Tally">Length</a></td>
<td><a href="https://aplwiki.com/wiki/Not_Equal_to">Not Equals</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="depth.html">Depth</a>*</td>
<td><a href="https://aplwiki.com/wiki/Match">Match</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Shape">Shape</a></td>
<td><a href="https://aplwiki.com/wiki/Not_Match">Not Match</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Identity">Identity</a></td>
<td><a href="https://aplwiki.com/wiki/Identity">Left</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Identity">Identity</a></td>
<td><a href="https://aplwiki.com/wiki/Identity">Right</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="reshape.html">Deshape</a></td>
<td><a href="reshape.html">Reshape</a>*</td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="join.html">Join</a>*</td>
<td><a href="join.html">Join to</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="couple.html">Solo</a>*</td>
<td><a href="couple.html">Couple</a>*</td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="prefixes.html">Prefixes</a>*</td>
<td><a href="https://aplwiki.com/wiki/Take">Take</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="prefixes.html">Suffixes</a>*</td>
<td><a href="https://aplwiki.com/wiki/Drop">Drop</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Index_Generator">Range</a></td>
<td><a href="windows.html">Windows</a>*</td>
</tr>
<tr>
<td><code><span class='Function'>»</span></code></td>
<td><a href="shift.html">Nudge</a>*</td>
<td><a href="shift.html">Shift Before</a>*</td>
</tr>
<tr>
<td><code><span class='Function'>«</span></code></td>
<td><a href="shift.html">Nudge Back</a>*</td>
<td><a href="shift.html">Shift After</a>*</td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Reverse">Reverse</a></td>
<td><a href="https://aplwiki.com/wiki/Rotate">Rotate</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="transpose.html">Transpose</a>*</td>
<td><a href="transpose.html">Reorder axes</a>*</td>
</tr>
<tr>
<td><code><span class='Function'>/</span></code></td>
<td><a href="https://aplwiki.com/wiki/Indices">Indices</a></td>
<td><a href="https://aplwiki.com/wiki/Replicate">Replicate</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Grade">Grade Up</a></td>
<td><a href="https://aplwiki.com/wiki/Interval_Index">Bins Up</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Grade">Grade Down</a></td>
<td><a href="https://aplwiki.com/wiki/Interval_Index">Bins Down</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td>First Cell*</td>
<td>Select*</td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/First">First</a></td>
<td>Pick*</td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td>Classify* (<code><span class='Function'></span><span class='Modifier2'></span><span class='Function'></span></code>)</td>
<td><a href="https://aplwiki.com/wiki/Index_Of">Index of</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td>Occurrence Count*</td>
<td>Progressive Index of*</td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Nub_Sieve">Unique Mask</a></td>
<td><a href="https://aplwiki.com/wiki/Membership">Member of</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="https://aplwiki.com/wiki/Unique">Deduplicate</a></td>
<td><a href="https://aplwiki.com/wiki/Find">Find</a></td>
</tr>
<tr>
<td><code><span class='Function'></span></code></td>
<td><a href="group.html">Group Indices</a>*</td>
<td><a href="group.html">Group</a>*</td>
</tr>
<tr>
<td><code><span class='Function'>!</span></code></td>
<td>Assert*</td>
<td>Assert with Message*</td>
</tr>
</tbody>
</table>
<h2 id="modifiers">Modifiers</h2>
<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='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='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='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='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='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='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='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='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='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='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='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='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><em>Combinators</em> only control the application of functions. Because a non-function operand applies as a constant function, some combinators have extra meanings when passed a constant. For example, <code><span class='Number'>0</span><span class='Modifier'>˜</span></code> is identical to <code><span class='Number'>0</span><span class='Modifier'>˙</span></code>—a constant function that always returns 0—and <code><span class='Number'>0</span><span class='Modifier2'></span><span class='Function'>&lt;</span></code> is the function that tests whether its right argument is greater than 0.</p>
<table>
<thead>
<tr>
<th>Glyph</th>
<th>Name(s)</th>
<th>Definition</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><span class='Modifier'>˙</span></code></td>
<td>Constant</td>
<td><code><span class='Brace'>{</span><span class='Value'>𝕩</span><span class='Separator'></span><span class='Value'>𝕗</span><span class='Brace'>}</span></code></td>
<td>Return a function that returns the operand</td>
</tr>
<tr>
<td><code><span class='Modifier'>˜</span></code></td>
<td>Self/Swap</td>
<td><code><span class='Brace'>{</span><span class='Value'>𝕩</span><span class='Function'>𝔽</span><span class='Value'>𝕨</span><span class='Function'></span><span class='Value'>𝕩</span><span class='Brace'>}</span></code></td>
<td>Duplicate one argument or exchange two</td>
</tr>
<tr>
<td><code><span class='Modifier2'></span></code></td>
<td>Atop</td>
<td><code><span class='Brace'>{</span><span class='Function'>𝔽</span><span class='Value'>𝕨</span><span class='Function'>𝔾</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code></td>
<td>Apply <code><span class='Function'>𝔾</span></code> to both arguments and <code><span class='Function'>𝔽</span></code> to the result</td>
</tr>
<tr>
<td><code><span class='Modifier2'></span></code></td>
<td>Over</td>
<td><code><span class='Brace'>{</span><span class='Paren'>(</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></code></td>
<td>Apply <code><span class='Function'>𝔾</span></code> to each argument and <code><span class='Function'>𝔽</span></code> to the results</td>
</tr>
<tr>
<td><code><span class='Modifier2'></span></code></td>
<td>Before/Bind</td>
<td><code><span class='Brace'>{</span><span class='Paren'>(</span><span class='Function'>𝔽</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></code></td>
<td><code><span class='Function'>𝔾</span></code>'s left argument comes from <code><span class='Function'>𝔽</span></code></td>
</tr>
<tr>
<td><code><span class='Modifier2'></span></code></td>
<td>After/Bind</td>
<td><code><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></code></td>
<td><code><span class='Function'>𝔽</span></code>'s right argument comes from <code><span class='Function'>𝔾</span></code></td>
</tr>
<tr>
<td><code><span class='Modifier2'></span></code></td>
<td>Under</td>
<td><code><span class='Brace'>{</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='Brace'>}</span></code> OR <code><span class='Brace'>{</span><span class='Paren'>(</span><span class='Function'>𝔾</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Gets'></span><span class='Value'>𝕨</span><span class='Function'>𝔽</span><span class='Modifier2'></span><span class='Function'>𝔾</span><span class='Value'>𝕩</span><span class='Separator'></span><span class='Value'>𝕩</span><span class='Brace'>}</span></code></td>
<td>Apply <code><span class='Function'>𝔽</span></code> over <code><span class='Function'>𝔾</span></code>, then undo <code><span class='Function'>𝔾</span></code></td>
</tr>
<tr>
<td><code><span class='Modifier2'></span></code></td>
<td>Valences</td>
<td><code><span class='Brace'>{</span><span class='Function'>𝔽</span><span class='Value'>𝕩;𝕨</span><span class='Function'>𝔾</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code></td>
<td>Apply <code><span class='Function'>𝔽</span></code> if there's one argument but <code><span class='Function'>𝔾</span></code> if there are two</td>
</tr>
<tr>
<td><code><span class='Modifier2'></span></code></td>
<td>Choose</td>
<td><code><span class='Brace'>{</span><span class='Value'>f</span><span class='Gets'></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='Separator'></span> <span class='Value'>𝕨</span><span class='Function'>F</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code></td>
<td>Select one of the functions in list <code><span class='Value'>𝕘</span></code> based on <code><span class='Function'>𝔽</span></code></td>
</tr>
</tbody>
</table>
<p>Choose isn't really a combinator since it calls the function <code><span class='Function'></span></code>, and Under is not a true combinator since it has an &quot;undo&quot; step at the end. This step might be implemented using the left operand's inverse (<em>computational</em> Under) or its structural properties (<em>structural</em> Under).</p>
<p>Other modifiers control array traversal and iteration. In three cases a simpler 1-modifier is paired with a generalized 2-modifier: in each case the 1-modifier happens to be the same as the 2-modifier with a right operand of <code><span class='Number'>¯1</span></code>.</p>
<table>
<thead>
<tr>
<th>1-Modifier</th>
<th>Name</th>
<th>2-Modifier</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><code><span class='Modifier'>˘</span></code></td>
<td>Cells</td>
<td><code><span class='Modifier2'></span></code></td>
<td>Rank</td>
</tr>
<tr>
<td><code><span class='Modifier'>¨</span></code></td>
<td>Each</td>
<td><code><span class='Modifier2'></span></code></td>
<td>Depth</td>
</tr>
<tr>
<td><code><span class='Modifier'></span></code></td>
<td>Table</td>
<td></td>
<td></td>
</tr>
<tr>
<td><code><span class='Modifier'></span></code></td>
<td>Undo</td>
<td><code><span class='Modifier2'></span></code></td>
<td>Repeat</td>
</tr>
<tr>
<td><code><span class='Modifier'>´</span></code></td>
<td>Fold</td>
<td></td>
<td></td>
</tr>
<tr>
<td><code><span class='Modifier'>˝</span></code></td>
<td>Insert</td>
<td></td>
<td></td>
</tr>
<tr>
<td><code><span class='Modifier'>`</span></code></td>
<td>Scan</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>