Skip to content

Commit

Permalink
doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tfpractice committed Jul 3, 2017
1 parent 534cc00 commit fddfbc5
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 68 deletions.
26 changes: 17 additions & 9 deletions docs/accessors.html
Expand Up @@ -121,7 +121,8 @@ <h1>accessors.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">&#182;</a>
</div>
<p><strong>get</strong> <code>:: Iterable&lt;{k:v}&gt; -&gt; k -&gt; v</code><br>retrieves a value stored at a key from a collection</p>
<p><strong>get</strong> <code>:: Iterable&lt;{k:v}&gt; -&gt; k -&gt; v</code>
retrieves a value stored at a key from a collection</p>

</div>

Expand All @@ -136,11 +137,12 @@ <h1>accessors.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">&#182;</a>
</div>
<p><strong>fromIndex</strong> <code>:: Iterable&lt;a&gt; -&gt; number -&gt; a</code><br>returns the value stored at an Iterable<a> position</p>
<p><strong>fromIndex</strong> <code>:: Iterable&lt;a&gt; -&gt; number -&gt; a</code>
returns the value stored at an Iterable position</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> fromIndex = <span class="hljs-function">(<span class="hljs-params">c = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Set</span></span>) =&gt;</span> i =&gt; spread(c).slice(i, i + <span class="hljs-number">1</span>).shift();</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> fromIndex = <span class="hljs-function">(<span class="hljs-params">c = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Set</span>(</span>)) =&gt;</span> i =&gt; spread(c).slice(i, i + <span class="hljs-number">1</span>).shift();</pre></div></div>

</li>

Expand All @@ -151,7 +153,8 @@ <h1>accessors.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">&#182;</a>
</div>
<p><strong>first</strong> <code>:: Iterable&lt;a&gt; -&gt; a</code><br>returns the first element of an iterable</p>
<p><strong>first</strong> <code>:: Iterable&lt;a&gt; -&gt; a</code>
returns the first element of an iterable</p>

</div>

Expand All @@ -166,7 +169,8 @@ <h1>accessors.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">&#182;</a>
</div>
<p><strong>last</strong> <code>:: Iterable&lt;a&gt; -&gt; a</code><br>returns the last element of an iterable</p>
<p><strong>last</strong> <code>:: Iterable&lt;a&gt; -&gt; a</code>
returns the last element of an iterable</p>

</div>

Expand All @@ -181,7 +185,8 @@ <h1>accessors.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">&#182;</a>
</div>
<p><strong>firstK</strong> <code>:: Iterable&lt;{k:v}&gt; -&gt; k</code><br>returns the first key of an iterable</p>
<p><strong>firstK</strong> <code>:: Iterable&lt;{k:v}&gt; -&gt; k</code>
returns the first key of an iterable</p>

</div>

Expand All @@ -196,7 +201,8 @@ <h1>accessors.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-7">&#182;</a>
</div>
<p><strong>lastK</strong> <code>:: Iterable&lt;{k:v}&gt; -&gt; k</code><br>returns the last key of an iterable</p>
<p><strong>lastK</strong> <code>:: Iterable&lt;{k:v}&gt; -&gt; k</code>
returns the last key of an iterable</p>

</div>

Expand All @@ -211,7 +217,8 @@ <h1>accessors.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-8">&#182;</a>
</div>
<p><strong>firstV</strong> <code>:: Iterable&lt;a&gt; -&gt; a</code><br>returns the first value of an iterable</p>
<p><strong>firstV</strong> <code>:: Iterable&lt;a&gt; -&gt; a</code>
returns the first value of an iterable</p>

</div>

Expand All @@ -226,7 +233,8 @@ <h1>accessors.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-9">&#182;</a>
</div>
<p><strong>lastV</strong> <code>:: Iterable&lt;a&gt; -&gt; a -&gt; [a]</code><br>returns the last value of an iterable</p>
<p><strong>lastV</strong> <code>:: Iterable&lt;a&gt; -&gt; a -&gt; [a]</code>
returns the last value of an iterable</p>

</div>

Expand Down
4 changes: 2 additions & 2 deletions docs/array.html
Expand Up @@ -121,7 +121,7 @@ <h1>array.js</h1>
<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>
returns an Iterable<a> of the return values of a
returns an Iterable of the return values of a
function called on each element of an iterable</p>

</div>
Expand All @@ -138,7 +138,7 @@ <h1>array.js</h1>
<a class="pilcrow" href="#section-3">&#182;</a>
</div>
<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
returns an Iterable of the return values of a
function called on each element of an iterable</p>

</div>
Expand Down
6 changes: 3 additions & 3 deletions docs/cast.html
Expand Up @@ -120,7 +120,7 @@ <h1>cast.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">&#182;</a>
</div>
<p><strong>asArray</strong> <code>:: Iterable&lt;a&gt; -&gt; [a]</code><br>returns an Iterable<a> of the collections default iterator</p>
<p><strong>asArray</strong> <code>:: Iterable&lt;a&gt; -&gt; [a]</code><br>returns an Iterable of the collections default iterator</p>

</div>

Expand All @@ -135,7 +135,7 @@ <h1>cast.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">&#182;</a>
</div>
<p><strong>asSet</strong> <code>:: Iterable&lt;a&gt; -&gt; Set[a]</code><br>returns an Iterable<a> of the collections default iterator</p>
<p><strong>asSet</strong> <code>:: Iterable&lt;a&gt; -&gt; Set[a]</code><br>returns an Iterable of the collections default iterator</p>

</div>

Expand All @@ -150,7 +150,7 @@ <h1>cast.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">&#182;</a>
</div>
<p><strong>asMap</strong> <code>:: Iterable&lt;a&gt; -&gt; Map[a]</code><br>returns an Iterable<a> of the collections default iterator</p>
<p><strong>asMap</strong> <code>:: Iterable&lt;a&gt; -&gt; Map[a]</code><br>returns an Iterable of the collections default iterator</p>

</div>

Expand Down
25 changes: 16 additions & 9 deletions docs/compare.html
Expand Up @@ -122,7 +122,8 @@ <h1>compare.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">&#182;</a>
</div>
<p><strong>inter</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt; -&gt; [a]</code><br>returns elements shared between two iterables;</p>
<p><strong>inter</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt; -&gt; [a]</code>
returns elements shared between two iterables;</p>

</div>

Expand All @@ -137,7 +138,8 @@ <h1>compare.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">&#182;</a>
</div>
<p><strong>diff</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt; -&gt; [a]</code><br>returns elements of the first iterable absent from the second iterable</p>
<p><strong>diff</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt; -&gt; [a]</code>
returns elements of the first iterable absent from the second iterable</p>

</div>

Expand All @@ -152,7 +154,8 @@ <h1>compare.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">&#182;</a>
</div>
<p><strong>union</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt; -&gt; [a]</code><br>returns elements of both iterables</p>
<p><strong>union</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt; -&gt; [a]</code>
returns elements of both iterables</p>

</div>

Expand All @@ -167,12 +170,13 @@ <h1>compare.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">&#182;</a>
</div>
<p><strong>mapInter</strong> <code>:: Map[{k:v}] -&gt; Map[{k:v}] -&gt; Map[{k:v}]</code><br>returns elements shared between two maps;</p>
<p><strong>mapInter</strong> <code>:: Map[{k:v}] -&gt; Map[{k:v}] -&gt; Map[{k:v}]</code>
returns elements shared between two maps;</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> mapInter = <span class="hljs-function"><span class="hljs-params">c0</span> =&gt;</span> c1 =&gt;
spread(c0).filter(hasKV(c1)).reduce(addBinMap, <span class="hljs-keyword">new</span> <span class="hljs-built_in">Map</span>);</pre></div></div>
spread(c0).filter(hasKV(c1)).reduce(addBinMap, <span class="hljs-keyword">new</span> <span class="hljs-built_in">Map</span>());</pre></div></div>

</li>

Expand All @@ -183,12 +187,13 @@ <h1>compare.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">&#182;</a>
</div>
<p><strong>mapDiff</strong> <code>:: Map[{k:v}] -&gt; Map[{k:v}] -&gt; Map[{k:v}]</code><br>returns elements of the first map absent from the second map</p>
<p><strong>mapDiff</strong> <code>:: Map[{k:v}] -&gt; Map[{k:v}] -&gt; Map[{k:v}]</code>
returns elements of the first map absent from the second map</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> mapDiff = <span class="hljs-function"><span class="hljs-params">c0</span> =&gt;</span> c1 =&gt;
spread(c0).filter(xhasKV(c1)).reduce(addBinMap, <span class="hljs-keyword">new</span> <span class="hljs-built_in">Map</span>);</pre></div></div>
spread(c0).filter(xhasKV(c1)).reduce(addBinMap, <span class="hljs-keyword">new</span> <span class="hljs-built_in">Map</span>());</pre></div></div>

</li>

Expand All @@ -199,7 +204,8 @@ <h1>compare.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-7">&#182;</a>
</div>
<p><strong>mapUnion</strong> <code>:: Map[{k:v}] -&gt; Map[{k:v}] -&gt; Map[{k:v}]</code><br>returns elements of both maps</p>
<p><strong>mapUnion</strong> <code>:: Map[{k:v}] -&gt; Map[{k:v}] -&gt; Map[{k:v}]</code>
returns elements of both maps</p>

</div>

Expand All @@ -215,7 +221,8 @@ <h1>compare.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-8">&#182;</a>
</div>
<p><strong>mapUnion</strong> <code>:: Map[{k:v}] -&gt; Map[{k:v}] -&gt; Map[{k:v}]</code><br>returns elements of both maps</p>
<p><strong>mapUnion</strong> <code>:: Map[{k:v}] -&gt; Map[{k:v}] -&gt; Map[{k:v}]</code>
returns elements of both maps</p>

</div>

Expand Down
4 changes: 2 additions & 2 deletions docs/group.html
Expand Up @@ -166,7 +166,7 @@ <h1>group.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">&#182;</a>
</div>
<p><strong>flatten</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt; -&gt; [a]</code><br>returns an Iterable<a> of the contents of two iterables</p>
<p><strong>flatten</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt; -&gt; [a]</code><br>returns an Iterable of the contents of two iterables</p>

</div>

Expand All @@ -182,7 +182,7 @@ <h1>group.js</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">&#182;</a>
</div>
<p><strong>flattenBin</strong> <code>:: (Iterable&lt;a&gt;, Iterable&lt;a&gt;) -&gt; [a]</code><br>returns an Iterable<a> of the contents of two iterables</p>
<p><strong>flattenBin</strong> <code>:: (Iterable&lt;a&gt;, Iterable&lt;a&gt;) -&gt; [a]</code><br>returns an Iterable of the contents of two iterables</p>

</div>

Expand Down
6 changes: 3 additions & 3 deletions docs/iterable.html
Expand Up @@ -122,7 +122,7 @@ <h1>iterable.js</h1>
<a class="pilcrow" href="#section-2">&#182;</a>
</div>
<p><strong>iterify</strong> <code>:: obj -&gt; iterable</code>
returns the object or an Iterable<a> containging the object</p>
returns the object or an Iterable containing the object</p>

</div>

Expand Down Expand Up @@ -170,7 +170,7 @@ <h1>iterable.js</h1>
<a class="pilcrow" href="#section-5">&#182;</a>
</div>
<p><strong> removify </strong><code>:: obj -&gt; [map|set]</code>
returns the object or an Iterable<a> containging the object</p>
returns the object or an Iterable containging the object</p>

</div>

Expand All @@ -186,7 +186,7 @@ <h1>iterable.js</h1>
<a class="pilcrow" href="#section-6">&#182;</a>
</div>
<p><strong> hasify </strong> <code>:: obj -&gt; [map|set]</code>
returns the object or an Iterable<a> containging the object</p>
returns the object or an Iterable containging the object</p>

</div>

Expand Down
10 changes: 5 additions & 5 deletions docs/spread.html
Expand Up @@ -121,7 +121,7 @@ <h1>spread.js</h1>
<a class="pilcrow" href="#section-2">&#182;</a>
</div>
<p><strong>spread</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt;</code>
returns an Iterable<a> of the collections default iterator</p>
returns an Iterable of the collections default iterator</p>

</div>

Expand All @@ -137,7 +137,7 @@ <h1>spread.js</h1>
<a class="pilcrow" href="#section-3">&#182;</a>
</div>
<p><strong>spreadK</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt;</code>
returns an Iterable<a> of the collections keys</p>
returns an Iterable of the collections keys</p>

</div>

Expand All @@ -153,7 +153,7 @@ <h1>spread.js</h1>
<a class="pilcrow" href="#section-4">&#182;</a>
</div>
<p><strong>spreadV</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt;</code>
returns an Iterable<a> of the collections values</p>
returns an Iterable of the collections values</p>

</div>

Expand All @@ -169,7 +169,7 @@ <h1>spread.js</h1>
<a class="pilcrow" href="#section-5">&#182;</a>
</div>
<p><strong>spreadE</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt;</code>
returns an Iterable<a> of the collections entries</p>
returns an Iterable of the collections entries</p>

</div>

Expand All @@ -185,7 +185,7 @@ <h1>spread.js</h1>
<a class="pilcrow" href="#section-6">&#182;</a>
</div>
<p><strong>spreadKV</strong> <code>:: Iterable&lt;a&gt; -&gt; Iterable&lt;a&gt;</code>
returns an Iterable<a> of the collections entries</p>
returns an Iterable of the collections entries</p>

</div>

Expand Down
20 changes: 10 additions & 10 deletions src/accessors.js
Expand Up @@ -2,35 +2,35 @@
import { asMap, } from './cast';
import { spread, spreadK, spreadV, } from './spread';

// **get** `:: Iterable<{k:v}> -> k -> v`
// **get** `:: Iterable<{k:v}> -> k -> v`
// retrieves a value stored at a key from a collection
export const get = c => k => asMap(c).get(k);

// **fromIndex** `:: Iterable<a> -> number -> a`
// returns the value stored at an Iterable<a> position
export const fromIndex = (c = new Set) => i => spread(c).slice(i, i + 1).shift();
// **fromIndex** `:: Iterable<a> -> number -> a`
// returns the value stored at an Iterable position
export const fromIndex = (c = new Set()) => i => spread(c).slice(i, i + 1).shift();

// **first** `:: Iterable<a> -> a`
// **first** `:: Iterable<a> -> a`
// returns the first element of an iterable
export const first = (c = []) => spread(c).shift();

// **last** `:: Iterable<a> -> a`
// **last** `:: Iterable<a> -> a`
// returns the last element of an iterable
export const last = (c = []) => spread(c).pop();

// **firstK** `:: Iterable<{k:v}> -> k`
// **firstK** `:: Iterable<{k:v}> -> k`
// returns the first key of an iterable
export const firstK = (c = []) => first(spreadK(c));

// **lastK** `:: Iterable<{k:v}> -> k`
// **lastK** `:: Iterable<{k:v}> -> k`
// returns the last key of an iterable
export const lastK = (c = []) => last(spreadK(c));

// **firstV** `:: Iterable<a> -> a`
// **firstV** `:: Iterable<a> -> a`
// returns the first value of an iterable
export const firstV = (c = []) => first(spreadV(c));

// **lastV** `:: Iterable<a> -> a -> [a]`
// **lastV** `:: Iterable<a> -> a -> [a]`
// returns the last value of an iterable
export const lastV = (c = []) => last(spreadV(c));

Expand Down
6 changes: 3 additions & 3 deletions src/array.js
Expand Up @@ -2,15 +2,15 @@
import { spread, } from './spread';

// **map** `:: Iterable<a> -> (a->b) -> [b]`
// returns an Iterable<a> of the return values of a
// returns an Iterable of the return values of a
// function called on each element of an iterable
export const map = coll => fn => spread(coll).map(fn);

// **mapTo** `:: (a->b) -> Iterable<a> -> [b]`
// returns an Iterable<a> of the return values of a
// returns an Iterable of the return values of a
// function called on each element of an iterable
export const mapTo = fn => coll => map(coll)(fn);

// **reduce** `:: Iterable<a> -> ((a->b), b) -> b`
// returns the accumulated value of a function
// called on each element of an iterable
Expand Down
6 changes: 3 additions & 3 deletions src/cast.js
Expand Up @@ -2,13 +2,13 @@
import { spread, spreadKV, } from './spread';

// **asArray** `:: Iterable<a> -> [a]`
// returns an Iterable<a> of the collections default iterator
// returns an Iterable of the collections default iterator
export const asArray = c => spread(c);

// **asSet** `:: Iterable<a> -> Set[a]`
// returns an Iterable<a> of the collections default iterator
// returns an Iterable of the collections default iterator
export const asSet = c => new Set(spread(c));

// **asMap** `:: Iterable<a> -> Map[a]`
// returns an Iterable<a> of the collections default iterator
// returns an Iterable of the collections default iterator
export const asMap = c => new Map(spreadKV(c));

0 comments on commit fddfbc5

Please sign in to comment.