Skip to content

Commit beab537

Browse files
committed
UPDATE 2024-03-18
1 parent 56912ad commit beab537

File tree

5 files changed

+1567
-1566
lines changed

5 files changed

+1567
-1566
lines changed

experimental/cc.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h2 class="h500"><a href="#capabilities-and-capturing-types-1" class="anchor"></
115115
<h2 class="h500"><a href="#function-types-1" class="anchor"></a>Function Types</h2>
116116
<p>The usual function type <code>A =&gt; B</code> now stands for a function that can capture arbitrary capabilities. We call such functions <em>impure</em>. By contrast, the new single arrow function type <code>A -&gt; B</code> stands for a function that cannot capture any capabilities, or otherwise said, is <em>pure</em>. One can add a capture set after the arrow of an otherwise pure function. For instance, <code>A -&gt;{c, d} B</code> would be a function that can capture capabilities <code>c</code> and <code>d</code>, but no others. This type is a shorthand for <code>(A -&gt; B)^{c, d}</code>, i.e. the function type <code>A -&gt; B</code> with possible captures <code>{c, d}</code>.</p>
117117
<p>The impure function type <code>A =&gt; B</code> is treated as an alias for <code>A -&gt;{cap} B</code>. That is, impure functions are functions that can capture anything.</p>
118-
<p>A capture annotation <code>^</code> binds more strongly than a function arrow. So <code>A -&gt; B^{c}</code> is read as <code>A</code> -&gt; (B^{c})`.</p>
118+
<p>A capture annotation <code>^</code> binds more strongly than a function arrow. So <code>A -&gt; B^{c}</code> is read as <code>A -&gt; (B^{c})</code>.</p>
119119
<p>Analogous conventions apply to context function types. <code>A ?=&gt; B</code> is an impure context function, with <code>A ?-&gt; B</code> as its pure complement.</p>
120120
<p><strong>Note 1:</strong> The identifiers <code>-&gt;</code> and <code>?-&gt;</code> are now treated as soft keywords when used as infix type operators. They are still available as regular identifiers for terms. For instance, the mapping syntax <code>Map("x" -&gt; 1, "y" -&gt; 2)</code> is still supported since it only applies to terms.</p>
121121
<p><strong>Note 2:</strong> The distinctions between pure vs impure function types do not apply to methods. In fact, since methods are not values they never capture anything directly. References to capabilities in a method are instead counted in the capture set of the enclosing object.</p>

0 commit comments

Comments
 (0)