Skip to content

Commit

Permalink
length and match
Browse files Browse the repository at this point in the history
  • Loading branch information
tfpractice committed Jun 13, 2017
1 parent 7f6f6d6 commit 534cc00
Show file tree
Hide file tree
Showing 14 changed files with 682 additions and 53 deletions.
16 changes: 14 additions & 2 deletions docs/accessors.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,21 @@
</a>


<a class="source" href="length.html">
length.js
</a>


<a class="source" href="manipulate.html">
manipulate.js
</a>


<a class="source" href="match.html">
match.js
</a>


<a class="source" href="reducers.html">
reducers.js
</a>
Expand Down Expand Up @@ -100,7 +110,7 @@ <h1>accessors.js</h1>
</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">import</span> { asMap, } <span class="hljs-keyword">from</span> <span class="hljs-string">'./cast'</span>;
<span class="hljs-keyword">import</span> { spread, spreadK, spreadKV, spreadV, } <span class="hljs-keyword">from</span> <span class="hljs-string">'./spread'</span>;</pre></div></div>
<span class="hljs-keyword">import</span> { spread, spreadK, spreadV, } <span class="hljs-keyword">from</span> <span class="hljs-string">'./spread'</span>;</pre></div></div>

</li>

Expand Down Expand Up @@ -220,7 +230,9 @@ <h1>accessors.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> lastV = <span class="hljs-function">(<span class="hljs-params">c = []</span>) =&gt;</span> last(spreadV(c));</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> lastV = <span class="hljs-function">(<span class="hljs-params">c = []</span>) =&gt;</span> last(spreadV(c));

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> rest = <span class="hljs-function"><span class="hljs-params">coll</span> =&gt;</span> spread(coll).slice(<span class="hljs-number">1</span>);</pre></div></div>

</li>

Expand Down
119 changes: 109 additions & 10 deletions docs/array.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,21 @@
</a>


<a class="source" href="length.html">
length.js
</a>


<a class="source" href="manipulate.html">
manipulate.js
</a>


<a class="source" href="match.html">
match.js
</a>


<a class="source" href="reducers.html">
reducers.js
</a>
Expand Down Expand Up @@ -110,8 +120,9 @@ <h1>array.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">&#182;</a>
</div>
<p><strong>map</strong> <code>:: Iterable&lt;a&gt; -&gt; (a-&gt;b) -&gt; [b]</code><br>returns an Iterable<a> of the return values of a
function called on each element of an iterable </p>
<p><strong>map</strong> <code>:: Iterable&lt;a&gt; -&gt; (a-&gt;b) -&gt; [b]</code>
returns an Iterable<a> of the return values of a
function called on each element of an iterable</p>

</div>

Expand All @@ -126,12 +137,13 @@ <h1>array.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">&#182;</a>
</div>
<p><strong>reduce</strong> <code>:: Iterable&lt;a&gt; -&gt; ((a-&gt;b), b) -&gt; b</code><br>returns the accumulated value of a function
called on each element of an iterable </p>
<p><strong>mapTo</strong> <code>:: (a-&gt;b) -&gt; Iterable&lt;a&gt; -&gt; [b]</code>
returns an Iterable<a> of the return values of a
function called on each element of an iterable</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> reduce = <span class="hljs-function"><span class="hljs-params">coll</span> =&gt;</span> (fn, init) =&gt; spread(coll).reduce(fn, init);</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> mapTo = <span class="hljs-function"><span class="hljs-params">fn</span> =&gt;</span> coll =&gt; map(coll)(fn);</pre></div></div>

</li>

Expand All @@ -142,11 +154,13 @@ <h1>array.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">&#182;</a>
</div>
<p><strong>filter</strong> <code>:: Iterable&lt;a&gt; -&gt; (a-&gt;bool) -&gt; [a]</code><br>returns the iterable’s values which return true for a given function</p>
<p><strong>reduce</strong> <code>:: Iterable&lt;a&gt; -&gt; ((a-&gt;b), b) -&gt; b</code>
returns the accumulated value of a function
called on each element of an iterable</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> filter = <span class="hljs-function"><span class="hljs-params">coll</span> =&gt;</span> fn =&gt; spread(coll).filter(fn);</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> reduce = <span class="hljs-function"><span class="hljs-params">coll</span> =&gt;</span> (fn, init) =&gt; spread(coll).reduce(fn, init);</pre></div></div>

</li>

Expand All @@ -157,11 +171,13 @@ <h1>array.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">&#182;</a>
</div>
<p><strong>every</strong> <code>:: Iterable&lt;a&gt; -&gt; (a-&gt;bool) -&gt; bool</code><br>checks if every element of an iterable returns true for a given function</p>
<p><strong>reduceBy</strong> <code>:: ((a-&gt;b), b) -&gt; Iterable&lt;a&gt; -&gt; b</code>
returns the accumulated value of a function
called on each element of an iterable</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> every = <span class="hljs-function"><span class="hljs-params">coll</span> =&gt;</span> fn =&gt; spread(coll).every(fn);</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> reduceBy = <span class="hljs-function">(<span class="hljs-params">fn, init</span>) =&gt;</span> coll =&gt; spread(coll).reduce(fn, init);</pre></div></div>

</li>

Expand All @@ -172,14 +188,97 @@ <h1>array.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">&#182;</a>
</div>
<p><strong>some</strong> <code>:: Iterable&lt;a&gt; -&gt; (a-&gt;b) -&gt; [b]</code><br>checks if any element of an iterable returns true for a given function</p>
<p><strong>filter</strong> <code>:: Iterable&lt;a&gt; -&gt; (a-&gt;bool) -&gt; [a]</code>
returns the iterable’s values which return true for a given function</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> filter = <span class="hljs-function"><span class="hljs-params">coll</span> =&gt;</span> fn =&gt; spread(coll).filter(fn);</pre></div></div>

</li>


<li id="section-7">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-7">&#182;</a>
</div>
<p><strong>filtBy</strong> <code>:: (a-&gt;bool) -&gt; Iterable&lt;a&gt; -&gt; [a]</code>
returns the iterable’s values which return true for a given function</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> filtBy = <span class="hljs-function"><span class="hljs-params">fn</span> =&gt;</span> coll =&gt; filter(coll)(fn);</pre></div></div>

</li>


<li id="section-8">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-8">&#182;</a>
</div>
<p><strong>every</strong> <code>:: Iterable&lt;a&gt; -&gt; (a-&gt;bool) -&gt; bool</code>
checks if every element of an iterable returns true for a given function</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> every = <span class="hljs-function"><span class="hljs-params">coll</span> =&gt;</span> fn =&gt; spread(coll).every(fn);</pre></div></div>

</li>


<li id="section-9">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-9">&#182;</a>
</div>
<p><strong>everyPass</strong> <code>:: (a-&gt;bool) -&gt; Iterable&lt;a&gt; -&gt; bool</code>
checks if every element of an iterable returns true for a given function</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> everyPass = <span class="hljs-function"><span class="hljs-params">fn</span> =&gt;</span> coll =&gt; every(coll)(fn);</pre></div></div>

</li>


<li id="section-10">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-10">&#182;</a>
</div>
<p><strong>some</strong> <code>:: Iterable&lt;a&gt; -&gt; (a-&gt;b) -&gt; [b]</code>
checks if any element of an iterable returns true for a given function</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> some = <span class="hljs-function"><span class="hljs-params">coll</span> =&gt;</span> fn =&gt; spread(coll).some(fn);</pre></div></div>

</li>


<li id="section-11">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-11">&#182;</a>
</div>
<p><strong>somePass</strong> <code>:: (a-&gt;b) -&gt; Iterable&lt;a&gt; -&gt; [b]</code>
checks if any element of an iterable returns true for a given function</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> somePass = <span class="hljs-function"><span class="hljs-params">fn</span> =&gt;</span> coll =&gt; some(coll)(fn);

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> findBy = <span class="hljs-function"><span class="hljs-params">matchFunc</span> =&gt;</span> coll =&gt; spread(coll).find(matchFunc);</pre></div></div>

</li>

</ul>
</div>
</body>
Expand Down
12 changes: 11 additions & 1 deletion docs/cast.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,21 @@
</a>


<a class="source" href="length.html">
length.js
</a>


<a class="source" href="manipulate.html">
manipulate.js
</a>


<a class="source" href="match.html">
match.js
</a>


<a class="source" href="reducers.html">
reducers.js
</a>
Expand Down Expand Up @@ -99,7 +109,7 @@ <h1>cast.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">import</span> { spread, spreadKV, } <span class="hljs-keyword">from</span> <span class="hljs-string">'./spread'</span>;</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">import</span> { spread, spreadKV, } <span class="hljs-keyword">from</span> <span class="hljs-string">'./spread'</span>;</pre></div></div>

</li>

Expand Down
10 changes: 10 additions & 0 deletions docs/compare.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,21 @@
</a>


<a class="source" href="length.html">
length.js
</a>


<a class="source" href="manipulate.html">
manipulate.js
</a>


<a class="source" href="match.html">
match.js
</a>


<a class="source" href="reducers.html">
reducers.js
</a>
Expand Down
17 changes: 15 additions & 2 deletions docs/group.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,21 @@
</a>


<a class="source" href="length.html">
length.js
</a>


<a class="source" href="manipulate.html">
manipulate.js
</a>


<a class="source" href="match.html">
match.js
</a>


<a class="source" href="reducers.html">
reducers.js
</a>
Expand Down Expand Up @@ -99,7 +109,8 @@ <h1>group.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">import</span> { iterify, } <span class="hljs-keyword">from</span> <span class="hljs-string">'./iterable'</span>;</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">import</span> { iterify, } <span class="hljs-keyword">from</span> <span class="hljs-string">'./iterable'</span>;
<span class="hljs-keyword">import</span> { first, rest, } <span class="hljs-keyword">from</span> <span class="hljs-string">'./accessors'</span>;</pre></div></div>

</li>

Expand Down Expand Up @@ -235,7 +246,9 @@ <h1>group.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> appendBin = <span class="hljs-function">(<span class="hljs-params">c, v</span>) =&gt;</span> append(c)(v);</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> appendBin = <span class="hljs-function">(<span class="hljs-params">c, v</span>) =&gt;</span> append(c)(v);

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> turn = <span class="hljs-function"><span class="hljs-params">coll</span> =&gt;</span> append(rest(coll))(first(coll));</pre></div></div>

</li>

Expand Down
10 changes: 10 additions & 0 deletions docs/has.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,21 @@
</a>


<a class="source" href="length.html">
length.js
</a>


<a class="source" href="manipulate.html">
manipulate.js
</a>


<a class="source" href="match.html">
match.js
</a>


<a class="source" href="reducers.html">
reducers.js
</a>
Expand Down
Loading

0 comments on commit 534cc00

Please sign in to comment.