Deployed a982f25 to master with MkDocs 1.2.3 and mike 1.0.1

This commit is contained in:
GitHub Action 2021-10-20 08:04:31 +00:00
parent 269261d215
commit 575e19ec93
5 changed files with 37 additions and 11 deletions

View File

@ -1258,6 +1258,15 @@ and this project adheres to <a href="https://semver.org/spec/v2.0.0.html">Semant
<li>Assign patterns to variables (e.g. <code>let x::(t = y::_) = [1, 2, 3, 4]</code> where <code>t == [2, 3, 4]</code>)</li>
<li>Add builtin types (<code>AENS.name, AENS.pointee, Chain.ttl, Chain.base_tx, Chain.ga_meta_tx, Chain.paying_for_tx</code>) to
the calldata and result decoder</li>
<li>Patterns guards
<div class="highlight"><pre><span></span><code>switch(x)
a::[] | a &gt; 10 =&gt; 1
_ =&gt; 2
</code></pre></div>
<div class="highlight"><pre><span></span><code>function
f(a::[]) | a &gt; 10 = 1
f(_) = 2
</code></pre></div></li>
</ul>
<h3 id="changed">Changed</h3>
<ul>

File diff suppressed because one or more lines are too long

View File

@ -2,47 +2,47 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>None</loc>
<lastmod>2021-10-18</lastmod>
<lastmod>2021-10-20</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2021-10-18</lastmod>
<lastmod>2021-10-20</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2021-10-18</lastmod>
<lastmod>2021-10-20</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2021-10-18</lastmod>
<lastmod>2021-10-20</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2021-10-18</lastmod>
<lastmod>2021-10-20</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2021-10-18</lastmod>
<lastmod>2021-10-20</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2021-10-18</lastmod>
<lastmod>2021-10-20</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2021-10-18</lastmod>
<lastmod>2021-10-20</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
<lastmod>2021-10-18</lastmod>
<lastmod>2021-10-20</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

View File

@ -1533,6 +1533,7 @@ their respective arguments. For instance,</p>
get_left(Right(_)) = None
get_left(Both(x, _)) = Some(x)
</code></pre></div></p>
<p><em>NOTE: Data types cannot currently be recursive.</em></p>
<p>Sophia also supports the assignment of patterns to variables:
<div class="highlight"><pre><span></span><code>function f(x) = switch(x)
h1::(t = h2::_) =&gt; (h1 + h2)::t // same as `h1::h2::k =&gt; (h1 + h2)::h2::k`
@ -1542,7 +1543,23 @@ function g(p : int * option(int)) : int =
let (a, (o = Some(b))) = p // o is equal to Pair.snd(p)
b
</code></pre></div></p>
<p><em>NOTE: Data types cannot currently be recursive.</em></p>
<p>Guards are boolean expressions that can be used on patterns in both switch
statements and functions definitions. If a guard expression evaluates to
<code>true</code>, then the corresponding body will be used. Otherwise, the next pattern
will be checked:</p>
<div class="highlight"><pre><span></span><code>function get_left_if_positive(x : one_or_both(int, &#39;b)) : option(int) =
switch(x)
Left(x) | x &gt; 0 =&gt; Some(x)
Both(x, _) | x &gt; 0 =&gt; Some(x)
_ =&gt; None
</code></pre></div>
<div class="highlight"><pre><span></span><code>function
get_left_if_positive : one_or_both(int, &#39;b) =&gt; option(int)
get_left_if_positive(Left(x)) | x &gt; 0 = Some(x)
get_left_if_positive(Both(x, _)) | x &gt; 0 = Some(x)
get_left_if_positive(_) = None
</code></pre></div>
<p>Guards cannot be stateful even when used inside a stateful function.</p>
<h2 id="lists">Lists</h2>
<p>A Sophia list is a dynamically sized, homogenous, immutable, singly
linked list. A list is constructed with the syntax <code>[1, 2, 3]</code>. The