A little more bit o' docs.
This commit is contained in:
@@ -104,7 +104,7 @@
|
||||
<span class="p">(</span><span class="s1">'pred'</span><span class="p">,</span> <span class="p">[</span><span class="s1">'--'</span><span class="p">]),</span>
|
||||
<span class="p">(</span><span class="s1">'rolldown'</span><span class="p">,</span> <span class="p">[</span><span class="s1">'roll<'</span><span class="p">]),</span>
|
||||
<span class="p">(</span><span class="s1">'rollup'</span><span class="p">,</span> <span class="p">[</span><span class="s1">'roll>'</span><span class="p">]),</span>
|
||||
<span class="p">(</span><span class="s1">'id'</span><span class="p">,</span> <span class="p">[</span><span class="s1">'•'</span><span class="p">]),</span>
|
||||
<span class="p">(</span><span class="s1">'id'</span><span class="p">,</span> <span class="p">[</span><span class="sa">u</span><span class="s1">'•'</span><span class="p">]),</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
|
||||
@@ -141,7 +141,8 @@
|
||||
<span class="s1">run == [] swap infra</span>
|
||||
<span class="s1">sqr == dup mul</span>
|
||||
<span class="s1">size == 0 swap [pop ++] step</span>
|
||||
<span class="s1">cleave == [i] app2 [popd] dip</span>
|
||||
<span class="s1">fork == [i] app2</span>
|
||||
<span class="s1">cleave == fork [popd] dip</span>
|
||||
<span class="s1">average == [sum 1.0 *] [size] cleave /</span>
|
||||
<span class="s1">gcd == 1 [tuck modulus dup 0 >] loop pop</span>
|
||||
<span class="s1">least_fraction == dup [gcd] infra [div] concat map</span>
|
||||
@@ -157,8 +158,9 @@
|
||||
<span class="s1">step_zero == 0 roll> step</span>
|
||||
<span class="s1">codireco == cons dip rest cons</span>
|
||||
<span class="s1">make_generator == [codireco] ccons</span>
|
||||
<span class="s1">ifte == [nullary not] dipd branch</span>
|
||||
<span class="s1">'''</span>
|
||||
<span class="c1"># ifte == [nullary not] dipd branch</span>
|
||||
<span class="c1"># </span>
|
||||
<span class="c1"># ifte == [nullary] dipd swap branch</span>
|
||||
<span class="c1"># genrec == [[genrec] cons cons cons cons] nullary swons concat ifte</span>
|
||||
|
||||
@@ -510,6 +512,8 @@
|
||||
<span class="sd">'''Clear everything from the stack.</span>
|
||||
<span class="sd"> ::</span>
|
||||
|
||||
<span class="sd"> clear == stack [pop stack] loop</span>
|
||||
|
||||
<span class="sd"> ... clear</span>
|
||||
<span class="sd"> ---------------</span>
|
||||
|
||||
@@ -991,32 +995,32 @@
|
||||
<span class="k">return</span> <span class="n">stack</span><span class="p">,</span> <span class="n">concat</span><span class="p">(</span><span class="n">then</span> <span class="k">if</span> <span class="n">flag</span> <span class="k">else</span> <span class="n">else_</span><span class="p">,</span> <span class="n">expression</span><span class="p">),</span> <span class="n">dictionary</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="ifte"><a class="viewcode-back" href="../../library.html#joy.library.ifte">[docs]</a><span class="nd">@inscribe</span>
|
||||
<span class="nd">@FunctionWrapper</span>
|
||||
<span class="k">def</span> <span class="nf">ifte</span><span class="p">(</span><span class="n">stack</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dictionary</span><span class="p">):</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="sd"> If-Then-Else Combinator</span>
|
||||
<span class="sd"> ::</span>
|
||||
|
||||
<span class="sd"> ... [if] [then] [else] ifte</span>
|
||||
<span class="sd"> ---------------------------------------------------</span>
|
||||
<span class="sd"> ... [[else] [then]] [...] [if] infra select i</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="sd"> ... [if] [then] [else] ifte</span>
|
||||
<span class="sd"> -------------------------------------------------------</span>
|
||||
<span class="sd"> ... [else] [then] [...] [if] infra first choice i</span>
|
||||
|
||||
|
||||
<span class="sd"> Has the effect of grabbing a copy of the stack on which to run the</span>
|
||||
<span class="sd"> if-part using infra.</span>
|
||||
<span class="sd"> '''</span>
|
||||
<span class="p">(</span><span class="n">else_</span><span class="p">,</span> <span class="p">(</span><span class="n">then</span><span class="p">,</span> <span class="p">(</span><span class="n">if_</span><span class="p">,</span> <span class="n">stack</span><span class="p">)))</span> <span class="o">=</span> <span class="n">stack</span>
|
||||
<span class="n">expression</span> <span class="o">=</span> <span class="p">(</span><span class="n">S_infra</span><span class="p">,</span> <span class="p">(</span><span class="n">S_first</span><span class="p">,</span> <span class="p">(</span><span class="n">S_choice</span><span class="p">,</span> <span class="p">(</span><span class="n">S_i</span><span class="p">,</span> <span class="n">expression</span><span class="p">))))</span>
|
||||
<span class="n">stack</span> <span class="o">=</span> <span class="p">(</span><span class="n">if_</span><span class="p">,</span> <span class="p">(</span><span class="n">stack</span><span class="p">,</span> <span class="p">(</span><span class="n">then</span><span class="p">,</span> <span class="p">(</span><span class="n">else_</span><span class="p">,</span> <span class="n">stack</span><span class="p">))))</span>
|
||||
<span class="k">return</span> <span class="n">stack</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dictionary</span></div>
|
||||
<span class="c1">##@inscribe</span>
|
||||
<span class="c1">##@FunctionWrapper</span>
|
||||
<span class="c1">##def ifte(stack, expression, dictionary):</span>
|
||||
<span class="c1">## '''</span>
|
||||
<span class="c1">## If-Then-Else Combinator</span>
|
||||
<span class="c1">## ::</span>
|
||||
<span class="c1">##</span>
|
||||
<span class="c1">## ... [if] [then] [else] ifte</span>
|
||||
<span class="c1">## ---------------------------------------------------</span>
|
||||
<span class="c1">## ... [[else] [then]] [...] [if] infra select i</span>
|
||||
<span class="c1">##</span>
|
||||
<span class="c1">##</span>
|
||||
<span class="c1">##</span>
|
||||
<span class="c1">##</span>
|
||||
<span class="c1">## ... [if] [then] [else] ifte</span>
|
||||
<span class="c1">## -------------------------------------------------------</span>
|
||||
<span class="c1">## ... [else] [then] [...] [if] infra first choice i</span>
|
||||
<span class="c1">##</span>
|
||||
<span class="c1">##</span>
|
||||
<span class="c1">## Has the effect of grabbing a copy of the stack on which to run the</span>
|
||||
<span class="c1">## if-part using infra.</span>
|
||||
<span class="c1">## '''</span>
|
||||
<span class="c1">## (else_, (then, (if_, stack))) = stack</span>
|
||||
<span class="c1">## expression = (S_infra, (S_first, (S_choice, (S_i, expression))))</span>
|
||||
<span class="c1">## stack = (if_, (stack, (then, (else_, stack))))</span>
|
||||
<span class="c1">## return stack, expression, dictionary</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="cond"><a class="viewcode-back" href="../../library.html#joy.library.cond">[docs]</a><span class="nd">@inscribe</span>
|
||||
|
||||
@@ -75,16 +75,14 @@
|
||||
</li>
|
||||
</ul></li>
|
||||
<li><a href="library.html#joy.library.add_aliases">add_aliases() (in module joy.library)</a>
|
||||
</li>
|
||||
<li><a href="library.html#joy.library.DefinitionWrapper.add_def">add_def() (joy.library.DefinitionWrapper class method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="library.html#joy.library.DefinitionWrapper.add_def">add_def() (joy.library.DefinitionWrapper class method)</a>
|
||||
</li>
|
||||
<li><a href="library.html#joy.library.DefinitionWrapper.add_definitions">add_definitions() (joy.library.DefinitionWrapper class method)</a>
|
||||
</li>
|
||||
<li><a href="types.html#joy.utils.types.AnyJoyType">AnyJoyType (class in joy.utils.types)</a>
|
||||
</li>
|
||||
<li><a href="types.html#joy.utils.polytypes.AnyStarJoyType">AnyStarJoyType (class in joy.utils.polytypes)</a>
|
||||
</li>
|
||||
<li><a href="library.html#joy.library.app1">app1() (in module joy.library)</a>
|
||||
</li>
|
||||
@@ -245,8 +243,6 @@
|
||||
<li><a href="library.html#joy.library.i">i() (in module joy.library)</a>
|
||||
</li>
|
||||
<li><a href="library.html#joy.library.id_">id_() (in module joy.library)</a>
|
||||
</li>
|
||||
<li><a href="library.html#joy.library.ifte">ifte() (in module joy.library)</a>
|
||||
</li>
|
||||
<li><a href="types.html#joy.utils.polytypes.infer">infer() (in module joy.utils.polytypes)</a>
|
||||
</li>
|
||||
@@ -300,16 +296,8 @@
|
||||
<h2 id="K">K</h2>
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="types.html#joy.utils.polytypes.AnyStarJoyType.kind">kind (joy.utils.polytypes.AnyStarJoyType attribute)</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="types.html#joy.utils.polytypes.KleeneStar.kind">(joy.utils.polytypes.KleeneStar attribute)</a>
|
||||
<li><a href="types.html#joy.utils.polytypes.KleeneStar.kind">kind (joy.utils.polytypes.KleeneStar attribute)</a>
|
||||
</li>
|
||||
<li><a href="types.html#joy.utils.polytypes.NumberStarJoyType.kind">(joy.utils.polytypes.NumberStarJoyType attribute)</a>
|
||||
</li>
|
||||
<li><a href="types.html#joy.utils.polytypes.StackStarJoyType.kind">(joy.utils.polytypes.StackStarJoyType attribute)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="types.html#joy.utils.polytypes.KleeneStar">KleeneStar (class in joy.utils.polytypes)</a>
|
||||
@@ -349,10 +337,6 @@
|
||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="types.html#joy.utils.types.NumberJoyType">NumberJoyType (class in joy.utils.types)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="types.html#joy.utils.polytypes.NumberStarJoyType">NumberStarJoyType (class in joy.utils.polytypes)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
</tr></table>
|
||||
@@ -450,8 +434,6 @@
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="types.html#joy.utils.polytypes.StackStarJoyType">StackStarJoyType (class in joy.utils.polytypes)</a>
|
||||
</li>
|
||||
<li><a href="library.html#joy.library.step">step() (in module joy.library)</a>
|
||||
</li>
|
||||
<li><a href="library.html#joy.utils.generated_library.stuncons">stuncons() (in module joy.utils.generated_library)</a>
|
||||
|
||||
@@ -140,7 +140,7 @@ interesting aspects. It’s quite a treasure trove.</p>
|
||||
<li class="toctree-l2"><a class="reference internal" href="notebooks/Developing.html">Developing a Program in Joy</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="notebooks/Quadratic.html">Quadratic formula</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="notebooks/Replacing.html">Replacing Functions in the Dictionary</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="notebooks/Recursion_Combinators.html">Recursive Combinators</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="notebooks/Recursion_Combinators.html">Recursion Combinators</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="notebooks/Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="notebooks/Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="notebooks/Generator_Programs.html">Using <code class="docutils literal notranslate"><span class="pre">x</span></code> to Generate Values</a></li>
|
||||
|
||||
@@ -187,7 +187,9 @@ Boolean value (so empty string, zero, etc. are counted as false, etc.)</p>
|
||||
<dt id="joy.library.clear">
|
||||
<code class="descclassname">joy.library.</code><code class="descname">clear</code><span class="sig-paren">(</span><em>stack</em>, <em>expression</em>, <em>dictionary</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/library.html#clear"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.library.clear" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Clear everything from the stack.</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="o">...</span> <span class="n">clear</span>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">clear</span> <span class="o">==</span> <span class="n">stack</span> <span class="p">[</span><span class="n">pop</span> <span class="n">stack</span><span class="p">]</span> <span class="n">loop</span>
|
||||
|
||||
<span class="o">...</span> <span class="n">clear</span>
|
||||
<span class="o">---------------</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
@@ -403,26 +405,6 @@ onto the pending expression for evaluation.</p>
|
||||
<dd><p>The identity function.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="joy.library.ifte">
|
||||
<code class="descclassname">joy.library.</code><code class="descname">ifte</code><span class="sig-paren">(</span><em>stack</em>, <em>expression</em>, <em>dictionary</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/library.html#ifte"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.library.ifte" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>If-Then-Else Combinator</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="o">...</span> <span class="p">[</span><span class="k">if</span><span class="p">]</span> <span class="p">[</span><span class="n">then</span><span class="p">]</span> <span class="p">[</span><span class="k">else</span><span class="p">]</span> <span class="n">ifte</span>
|
||||
<span class="o">---------------------------------------------------</span>
|
||||
<span class="o">...</span> <span class="p">[[</span><span class="k">else</span><span class="p">]</span> <span class="p">[</span><span class="n">then</span><span class="p">]]</span> <span class="p">[</span><span class="o">...</span><span class="p">]</span> <span class="p">[</span><span class="k">if</span><span class="p">]</span> <span class="n">infra</span> <span class="n">select</span> <span class="n">i</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<span class="o">...</span> <span class="p">[</span><span class="k">if</span><span class="p">]</span> <span class="p">[</span><span class="n">then</span><span class="p">]</span> <span class="p">[</span><span class="k">else</span><span class="p">]</span> <span class="n">ifte</span>
|
||||
<span class="o">-------------------------------------------------------</span>
|
||||
<span class="o">...</span> <span class="p">[</span><span class="k">else</span><span class="p">]</span> <span class="p">[</span><span class="n">then</span><span class="p">]</span> <span class="p">[</span><span class="o">...</span><span class="p">]</span> <span class="p">[</span><span class="k">if</span><span class="p">]</span> <span class="n">infra</span> <span class="n">first</span> <span class="n">choice</span> <span class="n">i</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Has the effect of grabbing a copy of the stack on which to run the
|
||||
if-part using infra.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="joy.library.infra">
|
||||
<code class="descclassname">joy.library.</code><code class="descname">infra</code><span class="sig-paren">(</span><em>stack</em>, <em>expression</em>, <em>dictionary</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/library.html#infra"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.library.infra" title="Permalink to this definition">¶</a></dt>
|
||||
|
||||
@@ -366,10 +366,9 @@ numbers sixty-six times and then four more.</p>
|
||||
</div>
|
||||
<div class="section" id="project-euler-problem-two">
|
||||
<h2>Project Euler Problem Two<a class="headerlink" href="#project-euler-problem-two" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">By</span> <span class="n">considering</span> <span class="n">the</span> <span class="n">terms</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">Fibonacci</span> <span class="n">sequence</span> <span class="n">whose</span> <span class="n">values</span> <span class="n">do</span> <span class="ow">not</span> <span class="n">exceed</span> <span class="n">four</span> <span class="n">million</span><span class="p">,</span>
|
||||
<span class="n">find</span> <span class="n">the</span> <span class="nb">sum</span> <span class="n">of</span> <span class="n">the</span> <span class="n">even</span><span class="o">-</span><span class="n">valued</span> <span class="n">terms</span><span class="o">.</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<blockquote>
|
||||
<div>By considering the terms in the Fibonacci sequence whose values do
|
||||
not exceed four million, find the sum of the even-valued terms.</div></blockquote>
|
||||
<p>Now that we have a generator for the Fibonacci sequence, we need a
|
||||
function that adds a term in the sequence to a sum if it is even, and
|
||||
<code class="docutils literal notranslate"><span class="pre">pop</span></code>s it otherwise.</p>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="Treating Trees II: treestep" href="Treestep.html" />
|
||||
<link rel="prev" title="Recursive Combinators" href="Recursion_Combinators.html" />
|
||||
<link rel="prev" title="Recursion Combinators" href="Recursion_Combinators.html" />
|
||||
|
||||
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
|
||||
|
||||
@@ -1373,7 +1373,7 @@ Tree-delete == [pop not] [pop] [_Tree_delete_R0] [_Tree_delete_R1] genrec
|
||||
<ul>
|
||||
<li><a href="../index.html">Documentation overview</a><ul>
|
||||
<li><a href="index.html">Essays about Programming in Joy</a><ul>
|
||||
<li>Previous: <a href="Recursion_Combinators.html" title="previous chapter">Recursive Combinators</a></li>
|
||||
<li>Previous: <a href="Recursion_Combinators.html" title="previous chapter">Recursion Combinators</a></li>
|
||||
<li>Next: <a href="Treestep.html" title="next chapter">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Recursive Combinators — Thun 0.2.0 documentation</title>
|
||||
<title>Recursion Combinators — Thun 0.2.0 documentation</title>
|
||||
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||||
<script type="text/javascript" src="../_static/documentation_options.js"></script>
|
||||
@@ -35,8 +35,8 @@
|
||||
<div class="code ipython2 highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">notebook_preamble</span> <span class="k">import</span> <span class="n">D</span><span class="p">,</span> <span class="n">DefinitionWrapper</span><span class="p">,</span> <span class="n">J</span><span class="p">,</span> <span class="n">V</span><span class="p">,</span> <span class="n">define</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="section" id="recursive-combinators">
|
||||
<h1>Recursive Combinators<a class="headerlink" href="#recursive-combinators" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="recursion-combinators">
|
||||
<h1>Recursion Combinators<a class="headerlink" href="#recursion-combinators" title="Permalink to this headline">¶</a></h1>
|
||||
<p>This article describes the <code class="docutils literal notranslate"><span class="pre">genrec</span></code> combinator, how to use it, and
|
||||
several generic specializations.</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="p">[</span><span class="k">if</span><span class="p">]</span> <span class="p">[</span><span class="n">then</span><span class="p">]</span> <span class="p">[</span><span class="n">rec1</span><span class="p">]</span> <span class="p">[</span><span class="n">rec2</span><span class="p">]</span> <span class="n">genrec</span>
|
||||
@@ -598,7 +598,7 @@ Wire”</a></p>
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<h3><a href="../index.html">Table Of Contents</a></h3>
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">Recursive Combinators</a><ul>
|
||||
<li><a class="reference internal" href="#">Recursion Combinators</a><ul>
|
||||
<li><a class="reference internal" href="#designing-recursive-functions">Designing Recursive Functions</a></li>
|
||||
<li><a class="reference internal" href="#primitive-recursive-functions">Primitive Recursive Functions</a></li>
|
||||
<li><a class="reference internal" href="#hylomorphism">Hylomorphism</a></li>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<link rel="index" title="Index" href="../genindex.html" />
|
||||
<link rel="search" title="Search" href="../search.html" />
|
||||
<link rel="next" title="Recursive Combinators" href="Recursion_Combinators.html" />
|
||||
<link rel="next" title="Recursion Combinators" href="Recursion_Combinators.html" />
|
||||
<link rel="prev" title="Quadratic formula" href="Quadratic.html" />
|
||||
|
||||
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
|
||||
@@ -185,7 +185,7 @@ and re-evaluate the expression.</p>
|
||||
<li><a href="../index.html">Documentation overview</a><ul>
|
||||
<li><a href="index.html">Essays about Programming in Joy</a><ul>
|
||||
<li>Previous: <a href="Quadratic.html" title="previous chapter">Quadratic formula</a></li>
|
||||
<li>Next: <a href="Recursion_Combinators.html" title="next chapter">Recursive Combinators</a></li>
|
||||
<li>Next: <a href="Recursion_Combinators.html" title="next chapter">Recursion Combinators</a></li>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<li class="toctree-l2"><a class="reference internal" href="Replacing.html#a-shorter-trace">A shorter trace</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Recursion_Combinators.html">Recursive Combinators</a><ul>
|
||||
<li class="toctree-l1"><a class="reference internal" href="Recursion_Combinators.html">Recursion Combinators</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html#designing-recursive-functions">Designing Recursive Functions</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html#primitive-recursive-functions">Primitive Recursive Functions</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Recursion_Combinators.html#hylomorphism">Hylomorphism</a></li>
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -277,17 +277,6 @@ is used to generate one.</p>
|
||||
we can capture more information about the type signatures of some functions,
|
||||
and we can introduce a kind of Kleene Star or sequence type that can stand for
|
||||
an unbounded sequence of other types.</p>
|
||||
<dl class="class">
|
||||
<dt id="joy.utils.polytypes.AnyStarJoyType">
|
||||
<em class="property">class </em><code class="descclassname">joy.utils.polytypes.</code><code class="descname">AnyStarJoyType</code><span class="sig-paren">(</span><em>number</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/utils/polytypes.html#AnyStarJoyType"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.utils.polytypes.AnyStarJoyType" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><dl class="attribute">
|
||||
<dt id="joy.utils.polytypes.AnyStarJoyType.kind">
|
||||
<code class="descname">kind</code><a class="headerlink" href="#joy.utils.polytypes.AnyStarJoyType.kind" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>alias of <a class="reference internal" href="#joy.utils.types.AnyJoyType" title="joy.utils.types.AnyJoyType"><code class="xref py py-class docutils literal notranslate"><span class="pre">joy.utils.types.AnyJoyType</span></code></a></p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="joy.utils.polytypes.CombinatorJoyType">
|
||||
<em class="property">class </em><code class="descclassname">joy.utils.polytypes.</code><code class="descname">CombinatorJoyType</code><span class="sig-paren">(</span><em>name</em>, <em>sec</em>, <em>number</em>, <em>expect=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/utils/polytypes.html#CombinatorJoyType"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.utils.polytypes.CombinatorJoyType" title="Permalink to this definition">¶</a></dt>
|
||||
@@ -324,8 +313,8 @@ guard against being used on invalid types.</p>
|
||||
<div>A*</div></blockquote>
|
||||
<p>The <cite>A*</cite> works by splitting the universe into two alternate histories:</p>
|
||||
<blockquote>
|
||||
<div><p>A* -> 0</p>
|
||||
<p>A* -> A A*</p>
|
||||
<div><p>A* → ∅</p>
|
||||
<p>A* → A A*</p>
|
||||
</div></blockquote>
|
||||
<p>The Kleene star variable disappears in one universe, and in the other
|
||||
it turns into an <cite>AnyJoyType</cite> variable followed by itself again.</p>
|
||||
@@ -339,28 +328,6 @@ dicts, the “unifiers”) that don’t lead to type conflicts.</p>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="joy.utils.polytypes.NumberStarJoyType">
|
||||
<em class="property">class </em><code class="descclassname">joy.utils.polytypes.</code><code class="descname">NumberStarJoyType</code><span class="sig-paren">(</span><em>number</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/utils/polytypes.html#NumberStarJoyType"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.utils.polytypes.NumberStarJoyType" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><dl class="attribute">
|
||||
<dt id="joy.utils.polytypes.NumberStarJoyType.kind">
|
||||
<code class="descname">kind</code><a class="headerlink" href="#joy.utils.polytypes.NumberStarJoyType.kind" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>alias of <a class="reference internal" href="#joy.utils.types.NumberJoyType" title="joy.utils.types.NumberJoyType"><code class="xref py py-class docutils literal notranslate"><span class="pre">joy.utils.types.NumberJoyType</span></code></a></p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="joy.utils.polytypes.StackStarJoyType">
|
||||
<em class="property">class </em><code class="descclassname">joy.utils.polytypes.</code><code class="descname">StackStarJoyType</code><span class="sig-paren">(</span><em>number</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/utils/polytypes.html#StackStarJoyType"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.utils.polytypes.StackStarJoyType" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><dl class="attribute">
|
||||
<dt id="joy.utils.polytypes.StackStarJoyType.kind">
|
||||
<code class="descname">kind</code><a class="headerlink" href="#joy.utils.polytypes.StackStarJoyType.kind" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>alias of <a class="reference internal" href="#joy.utils.types.StackJoyType" title="joy.utils.types.StackJoyType"><code class="xref py py-class docutils literal notranslate"><span class="pre">joy.utils.types.StackJoyType</span></code></a></p>
|
||||
</dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="joy.utils.polytypes.SymbolJoyType">
|
||||
<em class="property">class </em><code class="descclassname">joy.utils.polytypes.</code><code class="descname">SymbolJoyType</code><span class="sig-paren">(</span><em>name</em>, <em>sec</em>, <em>number</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/joy/utils/polytypes.html#SymbolJoyType"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#joy.utils.polytypes.SymbolJoyType" title="Permalink to this definition">¶</a></dt>
|
||||
|
||||
Reference in New Issue
Block a user