sanctuary-type-classes
Advanced tools
Comparing version 6.0.0 to 6.1.0
{ | ||
"name": "sanctuary-type-classes", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "Standard library for Fantasy Land", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
335
README.md
@@ -56,3 +56,3 @@ # sanctuary-type-classes | ||
<h4 name="TypeClass"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L128">TypeClass :: (String, String, Array TypeClass, a -> Boolean) -> TypeClass</a></code></h4> | ||
<h4 name="TypeClass"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L128">TypeClass :: (String, String, Array TypeClass, a -> Boolean) -> TypeClass</a></code></h4> | ||
@@ -104,3 +104,3 @@ The arguments are: | ||
<h4 name="Setoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L271">Setoid :: TypeClass</a></code></h4> | ||
<h4 name="Setoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L271">Setoid :: TypeClass</a></code></h4> | ||
@@ -114,3 +114,3 @@ `TypeClass` value for [Setoid][]. | ||
<h4 name="Ord"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L281">Ord :: TypeClass</a></code></h4> | ||
<h4 name="Ord"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L281">Ord :: TypeClass</a></code></h4> | ||
@@ -127,3 +127,3 @@ `TypeClass` value for [Ord][]. | ||
<h4 name="Semigroupoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L294">Semigroupoid :: TypeClass</a></code></h4> | ||
<h4 name="Semigroupoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L294">Semigroupoid :: TypeClass</a></code></h4> | ||
@@ -140,3 +140,3 @@ `TypeClass` value for [Semigroupoid][]. | ||
<h4 name="Category"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L307">Category :: TypeClass</a></code></h4> | ||
<h4 name="Category"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L307">Category :: TypeClass</a></code></h4> | ||
@@ -153,3 +153,3 @@ `TypeClass` value for [Category][]. | ||
<h4 name="Semigroup"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L320">Semigroup :: TypeClass</a></code></h4> | ||
<h4 name="Semigroup"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L320">Semigroup :: TypeClass</a></code></h4> | ||
@@ -166,3 +166,3 @@ `TypeClass` value for [Semigroup][]. | ||
<h4 name="Monoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L333">Monoid :: TypeClass</a></code></h4> | ||
<h4 name="Monoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L333">Monoid :: TypeClass</a></code></h4> | ||
@@ -179,3 +179,3 @@ `TypeClass` value for [Monoid][]. | ||
<h4 name="Functor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L346">Functor :: TypeClass</a></code></h4> | ||
<h4 name="Functor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L346">Functor :: TypeClass</a></code></h4> | ||
@@ -192,3 +192,3 @@ `TypeClass` value for [Functor][]. | ||
<h4 name="Bifunctor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L359">Bifunctor :: TypeClass</a></code></h4> | ||
<h4 name="Bifunctor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L359">Bifunctor :: TypeClass</a></code></h4> | ||
@@ -205,3 +205,3 @@ `TypeClass` value for [Bifunctor][]. | ||
<h4 name="Profunctor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L372">Profunctor :: TypeClass</a></code></h4> | ||
<h4 name="Profunctor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L372">Profunctor :: TypeClass</a></code></h4> | ||
@@ -218,3 +218,3 @@ `TypeClass` value for [Profunctor][]. | ||
<h4 name="Apply"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L385">Apply :: TypeClass</a></code></h4> | ||
<h4 name="Apply"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L385">Apply :: TypeClass</a></code></h4> | ||
@@ -231,3 +231,3 @@ `TypeClass` value for [Apply][]. | ||
<h4 name="Applicative"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L398">Applicative :: TypeClass</a></code></h4> | ||
<h4 name="Applicative"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L398">Applicative :: TypeClass</a></code></h4> | ||
@@ -244,3 +244,3 @@ `TypeClass` value for [Applicative][]. | ||
<h4 name="Chain"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L411">Chain :: TypeClass</a></code></h4> | ||
<h4 name="Chain"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L411">Chain :: TypeClass</a></code></h4> | ||
@@ -257,3 +257,3 @@ `TypeClass` value for [Chain][]. | ||
<h4 name="ChainRec"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L424">ChainRec :: TypeClass</a></code></h4> | ||
<h4 name="ChainRec"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L424">ChainRec :: TypeClass</a></code></h4> | ||
@@ -270,3 +270,3 @@ `TypeClass` value for [ChainRec][]. | ||
<h4 name="Monad"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L437">Monad :: TypeClass</a></code></h4> | ||
<h4 name="Monad"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L437">Monad :: TypeClass</a></code></h4> | ||
@@ -283,3 +283,3 @@ `TypeClass` value for [Monad][]. | ||
<h4 name="Alt"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L450">Alt :: TypeClass</a></code></h4> | ||
<h4 name="Alt"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L450">Alt :: TypeClass</a></code></h4> | ||
@@ -296,3 +296,3 @@ `TypeClass` value for [Alt][]. | ||
<h4 name="Plus"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L463">Plus :: TypeClass</a></code></h4> | ||
<h4 name="Plus"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L463">Plus :: TypeClass</a></code></h4> | ||
@@ -309,3 +309,3 @@ `TypeClass` value for [Plus][]. | ||
<h4 name="Alternative"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L476">Alternative :: TypeClass</a></code></h4> | ||
<h4 name="Alternative"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L476">Alternative :: TypeClass</a></code></h4> | ||
@@ -322,3 +322,3 @@ `TypeClass` value for [Alternative][]. | ||
<h4 name="Foldable"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L489">Foldable :: TypeClass</a></code></h4> | ||
<h4 name="Foldable"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L489">Foldable :: TypeClass</a></code></h4> | ||
@@ -335,3 +335,3 @@ `TypeClass` value for [Foldable][]. | ||
<h4 name="Traversable"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L502">Traversable :: TypeClass</a></code></h4> | ||
<h4 name="Traversable"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L502">Traversable :: TypeClass</a></code></h4> | ||
@@ -348,3 +348,3 @@ `TypeClass` value for [Traversable][]. | ||
<h4 name="Extend"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L515">Extend :: TypeClass</a></code></h4> | ||
<h4 name="Extend"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L515">Extend :: TypeClass</a></code></h4> | ||
@@ -361,3 +361,3 @@ `TypeClass` value for [Extend][]. | ||
<h4 name="Comonad"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L528">Comonad :: TypeClass</a></code></h4> | ||
<h4 name="Comonad"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L528">Comonad :: TypeClass</a></code></h4> | ||
@@ -374,3 +374,3 @@ `TypeClass` value for [Comonad][]. | ||
<h4 name="Contravariant"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L541">Contravariant :: TypeClass</a></code></h4> | ||
<h4 name="Contravariant"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L541">Contravariant :: TypeClass</a></code></h4> | ||
@@ -387,3 +387,3 @@ `TypeClass` value for [Contravariant][]. | ||
<h4 name="toString"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1091">toString :: a -> String</a></code></h4> | ||
<h4 name="toString"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1091">toString :: a -> String</a></code></h4> | ||
@@ -414,3 +414,3 @@ Returns a useful string representation of its argument. | ||
<h4 name="equals"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1139">equals :: (a, b) -> Boolean</a></code></h4> | ||
<h4 name="equals"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1139">equals :: (a, b) -> Boolean</a></code></h4> | ||
@@ -444,3 +444,3 @@ Returns `true` if its arguments are of the same type and equal according | ||
<h4 name="lt"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1189">lt :: (a, b) -> Boolean</a></code></h4> | ||
<h4 name="lt"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1189">lt :: (a, b) -> Boolean</a></code></h4> | ||
@@ -466,3 +466,3 @@ Returns `true` if its arguments are of the same type and the first is | ||
<h4 name="lte"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1213">lte :: (a, b) -> Boolean</a></code></h4> | ||
<h4 name="lte"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1213">lte :: (a, b) -> Boolean</a></code></h4> | ||
@@ -493,3 +493,3 @@ Returns `true` if its arguments are of the same type and the first | ||
<h4 name="gt"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1260">gt :: (a, b) -> Boolean</a></code></h4> | ||
<h4 name="gt"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1260">gt :: (a, b) -> Boolean</a></code></h4> | ||
@@ -515,3 +515,3 @@ Returns `true` if its arguments are of the same type and the first is | ||
<h4 name="gte"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1284">gte :: (a, b) -> Boolean</a></code></h4> | ||
<h4 name="gte"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1284">gte :: (a, b) -> Boolean</a></code></h4> | ||
@@ -537,4 +537,42 @@ Returns `true` if its arguments are of the same type and the first | ||
<h4 name="compose"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1308">compose :: Semigroupoid c => (c j k, c i j) -> c i k</a></code></h4> | ||
<h4 name="min"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1308">min :: Ord a => (a, a) -> a</a></code></h4> | ||
Returns the smaller of its two arguments. | ||
This function is derived from [`lte`](#lte). | ||
See also [`max`](#max). | ||
```javascript | ||
> min(10, 2) | ||
2 | ||
> min(new Date('1999-12-31'), new Date('2000-01-01')) | ||
new Date('1999-12-31') | ||
> min('10', '2') | ||
'10' | ||
``` | ||
<h4 name="max"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1330">max :: Ord a => (a, a) -> a</a></code></h4> | ||
Returns the larger of its two arguments. | ||
This function is derived from [`lte`](#lte). | ||
See also [`min`](#min). | ||
```javascript | ||
> max(10, 2) | ||
10 | ||
> max(new Date('1999-12-31'), new Date('2000-01-01')) | ||
new Date('2000-01-01') | ||
> max('10', '2') | ||
'2' | ||
``` | ||
<h4 name="compose"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1352">compose :: Semigroupoid c => (c j k, c i j) -> c i k</a></code></h4> | ||
Function wrapper for [`fantasy-land/compose`][]. | ||
@@ -550,3 +588,3 @@ | ||
<h4 name="id"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1323">id :: Category c => TypeRep c -> c</a></code></h4> | ||
<h4 name="id"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1367">id :: Category c => TypeRep c -> c</a></code></h4> | ||
@@ -563,3 +601,3 @@ Function wrapper for [`fantasy-land/id`][]. | ||
<h4 name="concat"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1338">concat :: Semigroup a => (a, a) -> a</a></code></h4> | ||
<h4 name="concat"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1382">concat :: Semigroup a => (a, a) -> a</a></code></h4> | ||
@@ -585,3 +623,3 @@ Function wrapper for [`fantasy-land/concat`][]. | ||
<h4 name="empty"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1362">empty :: Monoid m => TypeRep m -> m</a></code></h4> | ||
<h4 name="empty"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1406">empty :: Monoid m => TypeRep m -> m</a></code></h4> | ||
@@ -607,3 +645,3 @@ Function wrapper for [`fantasy-land/empty`][]. | ||
<h4 name="map"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1386">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/v6.1.0/index.js#L1430">map :: Functor f => (a -> b, f a) -> f b</a></code></h4> | ||
@@ -635,3 +673,3 @@ Function wrapper for [`fantasy-land/map`][]. | ||
<h4 name="bimap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1416">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/v6.1.0/index.js#L1460">bimap :: Bifunctor f => (a -> b, c -> d, f a c) -> f b d</a></code></h4> | ||
@@ -645,3 +683,3 @@ Function wrapper for [`fantasy-land/bimap`][]. | ||
<h4 name="promap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1428">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/v6.1.0/index.js#L1472">promap :: Profunctor p => (a -> b, c -> d, p b c) -> p a d</a></code></h4> | ||
@@ -658,3 +696,3 @@ Function wrapper for [`fantasy-land/promap`][]. | ||
<h4 name="ap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1443">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/v6.1.0/index.js#L1487">ap :: Apply f => (f (a -> b), f a) -> f b</a></code></h4> | ||
@@ -683,3 +721,3 @@ Function wrapper for [`fantasy-land/ap`][]. | ||
<h4 name="lift2"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1470">lift2 :: Apply f => (a -> b -> c, f a, f b) -> f c</a></code></h4> | ||
<h4 name="lift2"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1514">lift2 :: Apply f => (a -> b -> c, f a, f b) -> f c</a></code></h4> | ||
@@ -701,3 +739,3 @@ Lifts `a -> b -> c` to `Apply f => f a -> f b -> f c` and returns the | ||
<h4 name="lift3"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1490">lift3 :: Apply f => (a -> b -> c -> d, f a, f b, f c) -> f d</a></code></h4> | ||
<h4 name="lift3"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1534">lift3 :: Apply f => (a -> b -> c -> d, f a, f b, f c) -> f d</a></code></h4> | ||
@@ -719,3 +757,3 @@ Lifts `a -> b -> c -> d` to `Apply f => f a -> f b -> f c -> f d` and | ||
<h4 name="apFirst"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1510">apFirst :: Apply f => (f a, f b) -> f a</a></code></h4> | ||
<h4 name="apFirst"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1554">apFirst :: Apply f => (f a, f b) -> f a</a></code></h4> | ||
@@ -737,3 +775,3 @@ Combines two effectful actions, keeping only the result of the first. | ||
<h4 name="apSecond"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1530">apSecond :: Apply f => (f a, f b) -> f b</a></code></h4> | ||
<h4 name="apSecond"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1574">apSecond :: Apply f => (f a, f b) -> f b</a></code></h4> | ||
@@ -755,3 +793,3 @@ Combines two effectful actions, keeping only the result of the second. | ||
<h4 name="of"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1550">of :: Applicative f => (TypeRep f, a) -> f a</a></code></h4> | ||
<h4 name="of"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1594">of :: Applicative f => (TypeRep f, a) -> f a</a></code></h4> | ||
@@ -774,4 +812,36 @@ Function wrapper for [`fantasy-land/of`][]. | ||
<h4 name="chain"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1571">chain :: Chain m => (a -> m b, m a) -> m b</a></code></h4> | ||
<h4 name="append"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1615">append :: (Applicative f, Semigroup (f a)) => (a, f a) -> f a</a></code></h4> | ||
Returns the result of appending the first argument to the second. | ||
This function is derived from [`concat`](#concat) and [`of`](#of). | ||
See also [`prepend`](#prepend). | ||
```javascript | ||
> append(3, [1, 2]) | ||
[1, 2, 3] | ||
> append(3, Cons(1, Cons(2, Nil))) | ||
Cons(1, Cons(2, Cons(3, Nil))) | ||
``` | ||
<h4 name="prepend"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1634">prepend :: (Applicative f, Semigroup (f a)) => (a, f a) -> f a</a></code></h4> | ||
Returns the result of prepending the first argument to the second. | ||
This function is derived from [`concat`](#concat) and [`of`](#of). | ||
See also [`append`](#append). | ||
```javascript | ||
> prepend(1, [2, 3]) | ||
[1, 2, 3] | ||
> prepend(1, Cons(2, Cons(3, Nil))) | ||
Cons(1, Cons(2, Cons(3, Nil))) | ||
``` | ||
<h4 name="chain"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1653">chain :: Chain m => (a -> m b, m a) -> m b</a></code></h4> | ||
Function wrapper for [`fantasy-land/chain`][]. | ||
@@ -793,3 +863,3 @@ | ||
<h4 name="join"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1592">join :: Chain m => m (m a) -> m a</a></code></h4> | ||
<h4 name="join"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1674">join :: Chain m => m (m a) -> m a</a></code></h4> | ||
@@ -811,3 +881,3 @@ Removes one level of nesting from a nested monadic structure. | ||
<h4 name="chainRec"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1612">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/v6.1.0/index.js#L1694">chainRec :: ChainRec m => (TypeRep m, (a -> c, b -> c, a) -> m c, a) -> m b</a></code></h4> | ||
@@ -829,3 +899,3 @@ Function wrapper for [`fantasy-land/chainRec`][]. | ||
<h4 name="filter"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1632">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/v6.1.0/index.js#L1714">filter :: (Applicative f, Foldable f, Monoid (f a)) => (a -> Boolean, f a) -> f a</a></code></h4> | ||
@@ -847,3 +917,3 @@ Filters its second argument in accordance with the given predicate. | ||
<h4 name="filterM"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1655">filterM :: (Alternative m, Monad m) => (a -> Boolean, m a) -> m a</a></code></h4> | ||
<h4 name="filterM"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1739">filterM :: (Alternative m, Monad m) => (a -> Boolean, m a) -> m a</a></code></h4> | ||
@@ -874,3 +944,3 @@ Filters its second argument in accordance with the given predicate. | ||
<h4 name="alt"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1686">alt :: Alt f => (f a, f a) -> f a</a></code></h4> | ||
<h4 name="alt"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1770">alt :: Alt f => (f a, f a) -> f a</a></code></h4> | ||
@@ -896,3 +966,3 @@ Function wrapper for [`fantasy-land/alt`][]. | ||
<h4 name="zero"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1710">zero :: Plus f => TypeRep f -> f a</a></code></h4> | ||
<h4 name="zero"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1794">zero :: Plus f => TypeRep f -> f a</a></code></h4> | ||
@@ -915,3 +985,3 @@ Function wrapper for [`fantasy-land/zero`][]. | ||
<h4 name="reduce"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1731">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/v6.1.0/index.js#L1815">reduce :: Foldable f => ((b, a) -> b, b, f a) -> b</a></code></h4> | ||
@@ -931,4 +1001,158 @@ Function wrapper for [`fantasy-land/reduce`][]. | ||
<h4 name="traverse"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1749">traverse :: (Applicative f, Traversable t) => (TypeRep f, a -> f b, t a) -> f (t b)</a></code></h4> | ||
<h4 name="size"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1833">size :: Foldable f => f a -> Integer</a></code></h4> | ||
Returns the number of elements of the given structure. | ||
This function is derived from [`reduce`](#reduce). | ||
```javascript | ||
> size([]) | ||
0 | ||
> size(['foo', 'bar', 'baz']) | ||
3 | ||
> size(Nil) | ||
0 | ||
> size(Cons('foo', Cons('bar', Cons('baz', Nil)))) | ||
3 | ||
``` | ||
<h4 name="elem"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1858">elem :: (Setoid a, Foldable f) => (a, f a) -> Boolean</a></code></h4> | ||
Takes a value and a structure and returns `true` if the | ||
value is an element of the structure; `false` otherwise. | ||
This function is derived from [`equals`](#equals) and | ||
[`reduce`](#reduce). | ||
```javascript | ||
> elem('c', ['a', 'b', 'c']) | ||
true | ||
> elem('x', ['a', 'b', 'c']) | ||
false | ||
> elem(3, {x: 1, y: 2, z: 3}) | ||
true | ||
> elem(8, {x: 1, y: 2, z: 3}) | ||
false | ||
> elem(0, Just(0)) | ||
true | ||
> elem(0, Just(1)) | ||
false | ||
> elem(0, Nothing) | ||
false | ||
``` | ||
<h4 name="reverse"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1894">reverse :: (Applicative f, Foldable f, Monoid (f a)) => f a -> f a</a></code></h4> | ||
Reverses the elements of the given structure. | ||
This function is derived from [`concat`](#concat), [`empty`](#empty), | ||
[`of`](#of), and [`reduce`](#reduce). | ||
```javascript | ||
> reverse([1, 2, 3]) | ||
[3, 2, 1] | ||
> reverse(Cons(1, Cons(2, Cons(3, Nil)))) | ||
Cons(3, Cons(2, Cons(1, Nil))) | ||
``` | ||
<h4 name="sort"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1917">sort :: (Ord a, Applicative f, Foldable f, Monoid (f a)) => f a -> f a</a></code></h4> | ||
Performs a [stable sort][] of the elements of the given structure, | ||
using [`lte`](#lte) for comparisons. | ||
This function is derived from [`lte`](#lte), [`concat`](#concat), | ||
[`empty`](#empty), [`of`](#of), and [`reduce`](#reduce). | ||
See also [`sortBy`](#sortBy). | ||
```javascript | ||
> sort(['foo', 'bar', 'baz']) | ||
['bar', 'baz', 'foo'] | ||
> sort([Just(2), Nothing, Just(1)]) | ||
[Nothing, Just(1), Just(2)] | ||
> sort(Cons('foo', Cons('bar', Cons('baz', Nil)))) | ||
Cons('bar', Cons('baz', Cons('foo', Nil))) | ||
``` | ||
<h4 name="sortBy"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1941">sortBy :: (Ord b, Applicative f, Foldable f, Monoid (f a)) => (a -> b, f a) -> f a</a></code></h4> | ||
Performs a [stable sort][] of the elements of the given structure, | ||
using [`lte`](#lte) to compare the values produced by applying the | ||
given function to each element of the structure. | ||
This function is derived from [`lte`](#lte), [`concat`](#concat), | ||
[`empty`](#empty), [`of`](#of), and [`reduce`](#reduce). | ||
See also [`sort`](#sort). | ||
```javascript | ||
> sortBy(s => s.length, ['red', 'green', 'blue']) | ||
['red', 'blue', 'green'] | ||
> sortBy(s => s.length, ['black', 'white']) | ||
['black', 'white'] | ||
> sortBy(s => s.length, ['white', 'black']) | ||
['white', 'black'] | ||
> sortBy(s => s.length, Cons('red', Cons('green', Cons('blue', Nil)))) | ||
Cons('red', Cons('blue', Cons('green', Nil))) | ||
``` | ||
<h4 name="takeWhile"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L1986">takeWhile :: (Applicative f, Foldable f, Monoid (f a)) => (a -> Boolean, f a) -> f a</a></code></h4> | ||
Discards the first inner value which does not satisfy the predicate, and | ||
all subsequent inner values. | ||
This function is derived from [`concat`](#concat), [`empty`](#empty), | ||
[`of`](#of), and [`reduce`](#reduce). | ||
See also [`dropWhile`](#dropWhile). | ||
```javascript | ||
> takeWhile(s => /x/.test(s), ['xy', 'xz', 'yx', 'yz', 'zx', 'zy']) | ||
['xy', 'xz', 'yx'] | ||
> takeWhile(s => /y/.test(s), ['xy', 'xz', 'yx', 'yz', 'zx', 'zy']) | ||
['xy'] | ||
> takeWhile(s => /z/.test(s), ['xy', 'xz', 'yx', 'yz', 'zx', 'zy']) | ||
[] | ||
``` | ||
<h4 name="dropWhile"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L2011">dropWhile :: (Applicative f, Foldable f, Monoid (f a)) => (a -> Boolean, f a) -> f a</a></code></h4> | ||
Retains the first inner value which does not satisfy the predicate, and | ||
all subsequent inner values. | ||
This function is derived from [`concat`](#concat), [`empty`](#empty), | ||
[`of`](#of), and [`reduce`](#reduce). | ||
See also [`takeWhile`](#takeWhile). | ||
```javascript | ||
> dropWhile(s => /x/.test(s), ['xy', 'xz', 'yx', 'yz', 'zx', 'zy']) | ||
['yz', 'zx', 'zy'] | ||
> dropWhile(s => /y/.test(s), ['xy', 'xz', 'yx', 'yz', 'zx', 'zy']) | ||
['xz', 'yx', 'yz', 'zx', 'zy'] | ||
> dropWhile(s => /z/.test(s), ['xy', 'xz', 'yx', 'yz', 'zx', 'zy']) | ||
['xy', 'xz', 'yx', 'yz', 'zx', 'zy'] | ||
``` | ||
<h4 name="traverse"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L2036">traverse :: (Applicative f, Traversable t) => (TypeRep f, a -> f b, t a) -> f (t b)</a></code></h4> | ||
Function wrapper for [`fantasy-land/traverse`][]. | ||
@@ -949,3 +1173,3 @@ | ||
<h4 name="sequence"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1769">sequence :: (Applicative f, Traversable t) => (TypeRep f, t (f a)) -> f (t a)</a></code></h4> | ||
<h4 name="sequence"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L2056">sequence :: (Applicative f, Traversable t) => (TypeRep f, t (f a)) -> f (t a)</a></code></h4> | ||
@@ -964,3 +1188,3 @@ Inverts the given `t (f a)` to produce an `f (t a)`. | ||
<h4 name="extend"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1786">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/v6.1.0/index.js#L2073">extend :: Extend w => (w a -> b, w a) -> w b</a></code></h4> | ||
@@ -977,3 +1201,3 @@ Function wrapper for [`fantasy-land/extend`][]. | ||
<h4 name="extract"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1801">extract :: Comonad w => w a -> a</a></code></h4> | ||
<h4 name="extract"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L2088">extract :: Comonad w => w a -> a</a></code></h4> | ||
@@ -987,3 +1211,3 @@ Function wrapper for [`fantasy-land/extract`][]. | ||
<h4 name="contramap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.0.0/index.js#L1813">contramap :: Contravariant f => (b -> a, f a) -> f b</a></code></h4> | ||
<h4 name="contramap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v6.1.0/index.js#L2100">contramap :: Contravariant f => (b -> a, f a) -> f b</a></code></h4> | ||
@@ -1043,2 +1267,3 @@ Function wrapper for [`fantasy-land/contramap`][]. | ||
[`fantasy-land/zero`]: https://github.com/fantasyland/fantasy-land#zero-method | ||
[stable sort]: https://en.wikipedia.org/wiki/Sorting_algorithm#Stability | ||
[type-classes]: https://github.com/sanctuary-js/sanctuary-def#type-classes |
Sorry, the diff of this file is too big to display
106632
2059
1214