Skip to content

Commit

Permalink
Version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Oct 22, 2016
1 parent 6bced3c commit d9d267e
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 35 deletions.
102 changes: 68 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ This project provides:

## API

<h4 name="TypeClass"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L105">TypeClass :: (String, Array TypeClass, a -> Boolean) -> TypeClass</a></code></h4>
<h4 name="TypeClass"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L105">TypeClass :: (String, Array TypeClass, a -> Boolean) -> TypeClass</a></code></h4>

The arguments are:

Expand Down Expand Up @@ -86,7 +86,7 @@ dependencies; `false` otherwise.
to define parametrically polymorphic functions which verify their
type-class constraints at run time.

<h4 name="Setoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L237">Setoid :: TypeClass</a></code></h4>
<h4 name="Setoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L237">Setoid :: TypeClass</a></code></h4>

`TypeClass` value for [Setoid][].

Expand All @@ -95,7 +95,7 @@ type-class constraints at run time.
true
```

<h4 name="Semigroup"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L247">Semigroup :: TypeClass</a></code></h4>
<h4 name="Semigroup"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L247">Semigroup :: TypeClass</a></code></h4>

`TypeClass` value for [Semigroup][].

Expand All @@ -107,7 +107,7 @@ true
false
```

<h4 name="Monoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L260">Monoid :: TypeClass</a></code></h4>
<h4 name="Monoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L260">Monoid :: TypeClass</a></code></h4>

`TypeClass` value for [Monoid][].

Expand All @@ -119,7 +119,7 @@ true
false
```

<h4 name="Functor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L273">Functor :: TypeClass</a></code></h4>
<h4 name="Functor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L273">Functor :: TypeClass</a></code></h4>

`TypeClass` value for [Functor][].

Expand All @@ -131,7 +131,7 @@ true
false
```

<h4 name="Bifunctor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L286">Bifunctor :: TypeClass</a></code></h4>
<h4 name="Bifunctor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L286">Bifunctor :: TypeClass</a></code></h4>

`TypeClass` value for [Bifunctor][].

Expand All @@ -143,7 +143,7 @@ true
false
```

<h4 name="Profunctor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L299">Profunctor :: TypeClass</a></code></h4>
<h4 name="Profunctor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L299">Profunctor :: TypeClass</a></code></h4>

`TypeClass` value for [Profunctor][].

Expand All @@ -155,7 +155,7 @@ true
false
```

<h4 name="Apply"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L312">Apply :: TypeClass</a></code></h4>
<h4 name="Apply"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L312">Apply :: TypeClass</a></code></h4>

`TypeClass` value for [Apply][].

Expand All @@ -167,7 +167,7 @@ true
false
```

<h4 name="Applicative"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L325">Applicative :: TypeClass</a></code></h4>
<h4 name="Applicative"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L325">Applicative :: TypeClass</a></code></h4>

`TypeClass` value for [Applicative][].

Expand All @@ -179,7 +179,7 @@ true
false
```

<h4 name="Chain"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L338">Chain :: TypeClass</a></code></h4>
<h4 name="Chain"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L338">Chain :: TypeClass</a></code></h4>

`TypeClass` value for [Chain][].

Expand All @@ -191,7 +191,7 @@ true
false
```

<h4 name="ChainRec"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L351">ChainRec :: TypeClass</a></code></h4>
<h4 name="ChainRec"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L351">ChainRec :: TypeClass</a></code></h4>

`TypeClass` value for [ChainRec][].

Expand All @@ -203,7 +203,7 @@ true
false
```

<h4 name="Monad"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L364">Monad :: TypeClass</a></code></h4>
<h4 name="Monad"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L364">Monad :: TypeClass</a></code></h4>

`TypeClass` value for [Monad][].

Expand All @@ -215,7 +215,7 @@ true
false
```

<h4 name="Foldable"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L377">Foldable :: TypeClass</a></code></h4>
<h4 name="Foldable"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L377">Foldable :: TypeClass</a></code></h4>

`TypeClass` value for [Foldable][].

Expand All @@ -227,7 +227,7 @@ true
false
```

<h4 name="Traversable"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L390">Traversable :: TypeClass</a></code></h4>
<h4 name="Traversable"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L390">Traversable :: TypeClass</a></code></h4>

`TypeClass` value for [Traversable][].

Expand All @@ -239,7 +239,7 @@ true
false
```

<h4 name="Extend"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L403">Extend :: TypeClass</a></code></h4>
<h4 name="Extend"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L403">Extend :: TypeClass</a></code></h4>

`TypeClass` value for [Extend][].

Expand All @@ -251,7 +251,7 @@ true
false
```

<h4 name="Comonad"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L416">Comonad :: TypeClass</a></code></h4>
<h4 name="Comonad"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L416">Comonad :: TypeClass</a></code></h4>

`TypeClass` value for [Comonad][].

Expand All @@ -263,7 +263,7 @@ true
false
```

<h4 name="toString"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L816">toString :: a -> String</a></code></h4>
<h4 name="toString"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L816">toString :: a -> String</a></code></h4>

Returns a useful string representation of its argument.

Expand All @@ -289,7 +289,7 @@ and Object.
'Cons(1, Cons(2, Cons(3, Nil)))'
```

<h4 name="equals"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L864">equals :: (a, b) -> Boolean</a></code></h4>
<h4 name="equals"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L864">equals :: (a, b) -> Boolean</a></code></h4>

Returns `true` if its arguments are of the same type and equal according
to the type's [`fantasy-land/equals`][] method; `false` otherwise.
Expand All @@ -312,7 +312,7 @@ true
false
```

<h4 name="concat"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L911">concat :: Semigroup a => (a, a) -> a</a></code></h4>
<h4 name="concat"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L911">concat :: Semigroup a => (a, a) -> a</a></code></h4>

Function wrapper for [`fantasy-land/concat`][].

Expand All @@ -333,7 +333,7 @@ built-in types: String, Array, and Object.
Cons('foo', Cons('bar', Cons('baz', Cons('quux', Nil))))
```

<h4 name="empty"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L935">empty :: Monoid m => TypeRep m -> m</a></code></h4>
<h4 name="empty"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L935">empty :: Monoid m => TypeRep m -> m</a></code></h4>

Function wrapper for [`fantasy-land/empty`][].

Expand All @@ -354,7 +354,7 @@ built-in types: String, Array, and Object.
Nil
```

<h4 name="map"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L959">map :: Functor f => (a -> b, f a) -> f b</a></code></h4>
<h4 name="map"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L959">map :: Functor f => (a -> b, f a) -> f b</a></code></h4>

Function wrapper for [`fantasy-land/map`][].

Expand All @@ -381,7 +381,7 @@ Nil
Cons(1, Cons(2, Cons(3, Nil)))
```

<h4 name="bimap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L989">bimap :: Bifunctor f => (a -> b, c -> d, f a c) -> f b d</a></code></h4>
<h4 name="bimap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L989">bimap :: Bifunctor f => (a -> b, c -> d, f a c) -> f b d</a></code></h4>

Function wrapper for [`fantasy-land/bimap`][].

Expand All @@ -390,7 +390,7 @@ Function wrapper for [`fantasy-land/bimap`][].
Tuple('FOO', 8)
```

<h4 name="promap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1001">promap :: Profunctor p => (a -> b, c -> d, p b c) -> p a d</a></code></h4>
<h4 name="promap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1001">promap :: Profunctor p => (a -> b, c -> d, p b c) -> p a d</a></code></h4>

Function wrapper for [`fantasy-land/promap`][].

Expand All @@ -402,7 +402,7 @@ built-in types: Function.
11
```

<h4 name="ap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1016">ap :: Apply f => (f (a -> b), f a) -> f b</a></code></h4>
<h4 name="ap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1016">ap :: Apply f => (f (a -> b), f a) -> f b</a></code></h4>

Function wrapper for [`fantasy-land/ap`][].

Expand All @@ -423,7 +423,41 @@ Identity(8)
Cons(4, Cons(10, Cons(256, Cons(10000, Nil))))
```

<h4 name="of"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1040">of :: Applicative f => (TypeRep f, a) -> f a</a></code></h4>
<h4 name="lift2"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1040">lift2 :: Apply f => (a -> b -> c, f a, f b) -> f c</a></code></h4>

Lifts `a -> b -> c` to `Apply f => f a -> f b -> f c` and returns the
result of applying this to the given arguments.

This function is derived from [`map`](#map) and [`ap`](#ap).

See also [`lift3`](#lift3).

```javascript
> lift2(x => y => Math.pow(x, y), [10], [1, 2, 3])
[10, 100, 1000]

> lift2(x => y => Math.pow(x, y), Identity(10), Identity(3))
Identity(1000)
```

<h4 name="lift3"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1060">lift3 :: Apply f => (a -> b -> c -> d, f a, f b, f c) -> f d</a></code></h4>

Lifts `a -> b -> c -> d` to `Apply f => f a -> f b -> f c -> f d` and
returns the result of applying this to the given arguments.

This function is derived from [`map`](#map) and [`ap`](#ap).

See also [`lift2`](#lift2).

```javascript
> lift3(x => y => z => x + z + y, ['<'], ['>'], ['foo', 'bar', 'baz'])
['<foo>', '<bar>', '<baz>']

> lift3(x => y => z => x + z + y, Identity('<'), Identity('>'), Identity('baz'))
Identity('<baz>')
```

<h4 name="of"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1080">of :: Applicative f => (TypeRep f, a) -> f a</a></code></h4>

Function wrapper for [`fantasy-land/of`][].

Expand All @@ -441,7 +475,7 @@ built-in types: Array and Function.
Cons(42, Nil)
```

<h4 name="chain"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1061">chain :: Chain m => (a -> m b, m a) -> m b</a></code></h4>
<h4 name="chain"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1101">chain :: Chain m => (a -> m b, m a) -> m b</a></code></h4>

Function wrapper for [`fantasy-land/chain`][].

Expand All @@ -459,7 +493,7 @@ Cons(1, Cons(3, Nil))
'Hask'
```

<h4 name="chainRec"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1082">chainRec :: ChainRec m => (TypeRep m, (a -> c, b -> c, a) -> m c, a) -> m b</a></code></h4>
<h4 name="chainRec"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1122">chainRec :: ChainRec m => (TypeRep m, (a -> c, b -> c, a) -> m c, a) -> m b</a></code></h4>

Function wrapper for [`fantasy-land/chainRec`][].

Expand All @@ -476,7 +510,7 @@ built-in types: Array.
['oo!', 'oo?', 'on!', 'on?', 'no!', 'no?', 'nn!', 'nn?']
```

<h4 name="filter"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1102">filter :: (Applicative f, Foldable f, Monoid (f a)) => (a -> Boolean, f a) -> f a</a></code></h4>
<h4 name="filter"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1142">filter :: (Applicative f, Foldable f, Monoid (f a)) => (a -> Boolean, f a) -> f a</a></code></h4>

Filters its second argument in accordance with the given predicate.

Expand All @@ -493,7 +527,7 @@ See also [`filterM`](#filterM).
Cons(1, Cons(3, Nil))
```

<h4 name="filterM"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1125">filterM :: (Monad m, Monoid (m a)) => (a -> Boolean, m a) -> m a</a></code></h4>
<h4 name="filterM"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1165">filterM :: (Monad m, Monoid (m a)) => (a -> Boolean, m a) -> m a</a></code></h4>

Filters its second argument in accordance with the given predicate.

Expand All @@ -510,7 +544,7 @@ See also [`filter`](#filter).
Cons(1, Cons(3, Nil))
```

<h4 name="reduce"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1148">reduce :: Foldable f => ((b, a) -> b, b, f a) -> b</a></code></h4>
<h4 name="reduce"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1188">reduce :: Foldable f => ((b, a) -> b, b, f a) -> b</a></code></h4>

Function wrapper for [`fantasy-land/reduce`][].

Expand All @@ -525,7 +559,7 @@ built-in types: Array and Object.
'foobarbaz'
```

<h4 name="traverse"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1166">traverse :: (Applicative f, Traversable t) => (a -> f a, b -> f c, t b) -> f (t c)</a></code></h4>
<h4 name="traverse"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1206">traverse :: (Applicative f, Traversable t) => (a -> f a, b -> f c, t b) -> f (t c)</a></code></h4>

Function wrapper for [`fantasy-land/traverse`][].

Expand All @@ -542,7 +576,7 @@ See also [`sequence`](#sequence).
Identity([2, 3, 4])
```

<h4 name="sequence"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1186">sequence :: (Applicative f, Traversable t) => (a -> f a, t (f b)) -> f (t b)</a></code></h4>
<h4 name="sequence"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1226">sequence :: (Applicative f, Traversable t) => (a -> f a, t (f b)) -> f (t b)</a></code></h4>

Inverts the given `t (f b)` to produce an `f (t b)`.

Expand All @@ -556,7 +590,7 @@ This function is derived from [`traverse`](#traverse).
Identity([1, 2, 3])
```

<h4 name="extend"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1203">extend :: Extend w => (w a -> b, w a) -> w b</a></code></h4>
<h4 name="extend"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1243">extend :: Extend w => (w a -> b, w a) -> w b</a></code></h4>

Function wrapper for [`fantasy-land/extend`][].

Expand All @@ -568,7 +602,7 @@ built-in types: Array.
[4]
```

<h4 name="extract"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.1.0/index.js#L1218">extract :: Comonad w => w a -> a</a></code></h4>
<h4 name="extract"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v0.2.0/index.js#L1258">extract :: Comonad w => w a -> a</a></code></h4>

Function wrapper for [`fantasy-land/extract`][].

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sanctuary-type-classes",
"version": "0.1.0",
"version": "0.2.0",
"description": "Standard library for Fantasy Land",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit d9d267e

Please sign in to comment.