blob: b83a26c42f1c1d27a5ff299ec57cb3ad06e81fc4 (
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
|
<head>
<link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../style.css" rel="stylesheet"/>
<title>BQN: Middle Dot (·)</title>
</head>
<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../index.html">BQN</a> / <a href="index.html">help</a></div>
<h1 id="middle-dot-"><a class="header" href="#middle-dot-">Middle Dot (<code><span class='Nothing'>·</span></code>)</a></h1>
<h2 id="-nothing"><a class="header" href="#-nothing"><code><span class='Nothing'>·</span></code>: Nothing</a></h2>
<p><a class="fulldoc" href="../doc/expression.html#nothing">→full documentation</a></p>
<h3 id="in-trains"><a class="header" href="#in-trains">In Trains</a></h3>
<p>Nothing can serve as a left argument in a train to string together multiple monadic functions.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KC0rLSkgNQoKKC3CtystKSA1">↗️</a><pre> <span class='Paren'>(</span><span class='Function'>-+-</span><span class='Paren'>)</span> <span class='Number'>5</span>
¯10
<span class='Paren'>(</span><span class='Function'>-</span><span class='Nothing'>·</span><span class='Function'>+-</span><span class='Paren'>)</span> <span class='Number'>5</span>
5
</pre>
<h3 id="in-block-headers"><a class="header" href="#in-block-headers">In Block Headers</a></h3>
<p>For Block header pattern matching syntax, Nothing can be used to indicate an unused value.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=RiDihpAge/CdlYogYeKAv8K34oC/YjogYeKIvmJ9CgpGIDHigL8y4oC/Mw==">↗️</a><pre> <span class='Function'>F</span> <span class='Gets'>←</span> <span class='Brace'>{</span><span class='Function'>𝕊</span> <span class='Value'>a</span><span class='Ligature'>‿</span><span class='Nothing'>·</span><span class='Ligature'>‿</span><span class='Value'>b</span><span class='Head'>:</span> <span class='Value'>a</span><span class='Function'>∾</span><span class='Value'>b</span><span class='Brace'>}</span>
<span class='Function'>F</span> <span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>3</span>
⟨ 1 3 ⟩
</pre>
|