sanctuary-type-classes
Advanced tools
Comparing version 5.2.0 to 6.0.0
58
index.js
@@ -128,3 +128,3 @@ /* | ||
//# TypeClass :: (String, Array TypeClass, a -> Boolean) -> TypeClass | ||
//# TypeClass :: (String, String, Array TypeClass, a -> Boolean) -> TypeClass | ||
//. | ||
@@ -134,2 +134,3 @@ //. The arguments are: | ||
//. - the name of the type class, prefixed by its npm package name; | ||
//. - the documentation URL of the type class; | ||
//. - an array of dependencies; and | ||
@@ -147,6 +148,16 @@ //. - a predicate which accepts any JavaScript value and returns `true` | ||
//. // Foo :: TypeClass | ||
//. const Foo = Z.TypeClass('my-package/Foo', [], hasMethod('foo')); | ||
//. const Foo = Z.TypeClass( | ||
//. 'my-package/Foo', | ||
//. 'http://example.com/my-package#Foo', | ||
//. [], | ||
//. hasMethod('foo') | ||
//. ); | ||
//. | ||
//. // Bar :: TypeClass | ||
//. const Bar = Z.TypeClass('my-package/Bar', [Foo], hasMethod('bar')); | ||
//. const Bar = Z.TypeClass( | ||
//. 'my-package/Bar', | ||
//. 'http://example.com/my-package#Bar', | ||
//. [Foo], | ||
//. hasMethod('bar') | ||
//. ); | ||
//. ``` | ||
@@ -166,7 +177,8 @@ //. | ||
//. type-class constraints at run time. | ||
function TypeClass(name, dependencies, test) { | ||
function TypeClass(name, url, dependencies, test) { | ||
if (!(this instanceof TypeClass)) { | ||
return new TypeClass(name, dependencies, test); | ||
return new TypeClass(name, url, dependencies, test); | ||
} | ||
this.name = name; | ||
this.url = url; | ||
this.test = function(x) { | ||
@@ -239,11 +251,17 @@ return dependencies.every(function(d) { return d.test(x); }) && test(x); | ||
var name = 'sanctuary-type-classes/' + _name; | ||
var version = '6.0.0'; // updated programmatically | ||
var keys = Object.keys(requirements); | ||
var typeClass = TypeClass(name, dependencies, function(x) { | ||
return keys.every(function(_name) { | ||
var arg = requirements[_name] === Constructor ? x.constructor : x; | ||
return getBoundMethod(_name)(arg) != null; | ||
}); | ||
}); | ||
var typeClass = TypeClass( | ||
'sanctuary-type-classes/' + _name, | ||
'https://github.com/sanctuary-js/sanctuary-type-classes/tree/v' + version | ||
+ '#' + _name, | ||
dependencies, | ||
function(x) { | ||
return keys.every(function(_name) { | ||
var arg = requirements[_name] === Constructor ? x.constructor : x; | ||
return getBoundMethod(_name)(arg) != null; | ||
}); | ||
} | ||
); | ||
@@ -648,11 +666,3 @@ typeClass.methods = keys.reduce(function(methods, _name) { | ||
'new String(' + toString(this.valueOf()) + ')' : | ||
'"' + this.replace(/\\/g, '\\\\') | ||
.replace(/[\b]/g, '\\b') // \b matches word boundary; | ||
.replace(/\f/g, '\\f') // [\b] matches backspace | ||
.replace(/\n/g, '\\n') | ||
.replace(/\r/g, '\\r') | ||
.replace(/\t/g, '\\t') | ||
.replace(/\v/g, '\\v') | ||
.replace(/\0/g, '\\0') | ||
.replace(/"/g, '\\"') + '"'; | ||
JSON.stringify(this); | ||
} | ||
@@ -795,3 +805,3 @@ | ||
function Array$prototype$extend(f) { | ||
return [f(this)]; | ||
return this.map(function(_, idx, xs) { return f(xs.slice(idx)); }); | ||
} | ||
@@ -1791,4 +1801,4 @@ | ||
//. ```javascript | ||
//. > extend(xs => xs.length, ['foo', 'bar', 'baz', 'quux']) | ||
//. [4] | ||
//. > extend(ss => ss.join(''), ['x', 'y', 'z']) | ||
//. ['xyz', 'yz', 'z'] | ||
//. ``` | ||
@@ -1795,0 +1805,0 @@ function extend(f, extend_) { |
{ | ||
"name": "sanctuary-type-classes", | ||
"version": "5.2.0", | ||
"version": "6.0.0", | ||
"description": "Standard library for Fantasy Land", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
129
README.md
@@ -56,3 +56,3 @@ # sanctuary-type-classes | ||
<h4 name="TypeClass"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L128">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/v6.0.0/index.js#L128">TypeClass :: (String, String, Array TypeClass, a -> Boolean) -> TypeClass</a></code></h4> | ||
@@ -62,2 +62,3 @@ The arguments are: | ||
- the name of the type class, prefixed by its npm package name; | ||
- the documentation URL of the type class; | ||
- an array of dependencies; and | ||
@@ -75,6 +76,16 @@ - a predicate which accepts any JavaScript value and returns `true` | ||
// Foo :: TypeClass | ||
const Foo = Z.TypeClass('my-package/Foo', [], hasMethod('foo')); | ||
const Foo = Z.TypeClass( | ||
'my-package/Foo', | ||
'http://example.com/my-package#Foo', | ||
[], | ||
hasMethod('foo') | ||
); | ||
// Bar :: TypeClass | ||
const Bar = Z.TypeClass('my-package/Bar', [Foo], hasMethod('bar')); | ||
const Bar = Z.TypeClass( | ||
'my-package/Bar', | ||
'http://example.com/my-package#Bar', | ||
[Foo], | ||
hasMethod('bar') | ||
); | ||
``` | ||
@@ -95,3 +106,3 @@ | ||
<h4 name="Setoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L253">Setoid :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -105,3 +116,3 @@ `TypeClass` value for [Setoid][]. | ||
<h4 name="Ord"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L263">Ord :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -118,3 +129,3 @@ `TypeClass` value for [Ord][]. | ||
<h4 name="Semigroupoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L276">Semigroupoid :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -131,3 +142,3 @@ `TypeClass` value for [Semigroupoid][]. | ||
<h4 name="Category"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L289">Category :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -144,3 +155,3 @@ `TypeClass` value for [Category][]. | ||
<h4 name="Semigroup"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L302">Semigroup :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -157,3 +168,3 @@ `TypeClass` value for [Semigroup][]. | ||
<h4 name="Monoid"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L315">Monoid :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -170,3 +181,3 @@ `TypeClass` value for [Monoid][]. | ||
<h4 name="Functor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L328">Functor :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -183,3 +194,3 @@ `TypeClass` value for [Functor][]. | ||
<h4 name="Bifunctor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L341">Bifunctor :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -196,3 +207,3 @@ `TypeClass` value for [Bifunctor][]. | ||
<h4 name="Profunctor"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L354">Profunctor :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -209,3 +220,3 @@ `TypeClass` value for [Profunctor][]. | ||
<h4 name="Apply"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L367">Apply :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -222,3 +233,3 @@ `TypeClass` value for [Apply][]. | ||
<h4 name="Applicative"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L380">Applicative :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -235,3 +246,3 @@ `TypeClass` value for [Applicative][]. | ||
<h4 name="Chain"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L393">Chain :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -248,3 +259,3 @@ `TypeClass` value for [Chain][]. | ||
<h4 name="ChainRec"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L406">ChainRec :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -261,3 +272,3 @@ `TypeClass` value for [ChainRec][]. | ||
<h4 name="Monad"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L419">Monad :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -274,3 +285,3 @@ `TypeClass` value for [Monad][]. | ||
<h4 name="Alt"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L432">Alt :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -287,3 +298,3 @@ `TypeClass` value for [Alt][]. | ||
<h4 name="Plus"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L445">Plus :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -300,3 +311,3 @@ `TypeClass` value for [Plus][]. | ||
<h4 name="Alternative"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L458">Alternative :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -313,3 +324,3 @@ `TypeClass` value for [Alternative][]. | ||
<h4 name="Foldable"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L471">Foldable :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -326,3 +337,3 @@ `TypeClass` value for [Foldable][]. | ||
<h4 name="Traversable"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L484">Traversable :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -339,3 +350,3 @@ `TypeClass` value for [Traversable][]. | ||
<h4 name="Extend"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L497">Extend :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -352,3 +363,3 @@ `TypeClass` value for [Extend][]. | ||
<h4 name="Comonad"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L510">Comonad :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -365,3 +376,3 @@ `TypeClass` value for [Comonad][]. | ||
<h4 name="Contravariant"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L523">Contravariant :: TypeClass</a></code></h4> | ||
<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> | ||
@@ -378,3 +389,3 @@ `TypeClass` value for [Contravariant][]. | ||
<h4 name="toString"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1081">toString :: a -> String</a></code></h4> | ||
<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> | ||
@@ -405,3 +416,3 @@ Returns a useful string representation of its argument. | ||
<h4 name="equals"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1129">equals :: (a, b) -> Boolean</a></code></h4> | ||
<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> | ||
@@ -435,3 +446,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/v5.2.0/index.js#L1179">lt :: (a, b) -> Boolean</a></code></h4> | ||
<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> | ||
@@ -457,3 +468,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/v5.2.0/index.js#L1203">lte :: (a, b) -> Boolean</a></code></h4> | ||
<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> | ||
@@ -484,3 +495,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/v5.2.0/index.js#L1250">gt :: (a, b) -> Boolean</a></code></h4> | ||
<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> | ||
@@ -506,3 +517,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/v5.2.0/index.js#L1274">gte :: (a, b) -> Boolean</a></code></h4> | ||
<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> | ||
@@ -528,3 +539,3 @@ 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/v5.2.0/index.js#L1298">compose :: Semigroupoid c => (c j k, c i j) -> c i k</a></code></h4> | ||
<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> | ||
@@ -541,3 +552,3 @@ Function wrapper for [`fantasy-land/compose`][]. | ||
<h4 name="id"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1313">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.0.0/index.js#L1323">id :: Category c => TypeRep c -> c</a></code></h4> | ||
@@ -554,3 +565,3 @@ Function wrapper for [`fantasy-land/id`][]. | ||
<h4 name="concat"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1328">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.0.0/index.js#L1338">concat :: Semigroup a => (a, a) -> a</a></code></h4> | ||
@@ -576,3 +587,3 @@ Function wrapper for [`fantasy-land/concat`][]. | ||
<h4 name="empty"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1352">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.0.0/index.js#L1362">empty :: Monoid m => TypeRep m -> m</a></code></h4> | ||
@@ -598,3 +609,3 @@ Function wrapper for [`fantasy-land/empty`][]. | ||
<h4 name="map"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1376">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.0.0/index.js#L1386">map :: Functor f => (a -> b, f a) -> f b</a></code></h4> | ||
@@ -626,3 +637,3 @@ Function wrapper for [`fantasy-land/map`][]. | ||
<h4 name="bimap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1406">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.0.0/index.js#L1416">bimap :: Bifunctor f => (a -> b, c -> d, f a c) -> f b d</a></code></h4> | ||
@@ -636,3 +647,3 @@ Function wrapper for [`fantasy-land/bimap`][]. | ||
<h4 name="promap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1418">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.0.0/index.js#L1428">promap :: Profunctor p => (a -> b, c -> d, p b c) -> p a d</a></code></h4> | ||
@@ -649,3 +660,3 @@ Function wrapper for [`fantasy-land/promap`][]. | ||
<h4 name="ap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1433">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.0.0/index.js#L1443">ap :: Apply f => (f (a -> b), f a) -> f b</a></code></h4> | ||
@@ -674,3 +685,3 @@ Function wrapper for [`fantasy-land/ap`][]. | ||
<h4 name="lift2"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1460">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.0.0/index.js#L1470">lift2 :: Apply f => (a -> b -> c, f a, f b) -> f c</a></code></h4> | ||
@@ -692,3 +703,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/v5.2.0/index.js#L1480">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.0.0/index.js#L1490">lift3 :: Apply f => (a -> b -> c -> d, f a, f b, f c) -> f d</a></code></h4> | ||
@@ -710,3 +721,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/v5.2.0/index.js#L1500">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.0.0/index.js#L1510">apFirst :: Apply f => (f a, f b) -> f a</a></code></h4> | ||
@@ -728,3 +739,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/v5.2.0/index.js#L1520">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.0.0/index.js#L1530">apSecond :: Apply f => (f a, f b) -> f b</a></code></h4> | ||
@@ -746,3 +757,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/v5.2.0/index.js#L1540">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.0.0/index.js#L1550">of :: Applicative f => (TypeRep f, a) -> f a</a></code></h4> | ||
@@ -765,3 +776,3 @@ Function wrapper for [`fantasy-land/of`][]. | ||
<h4 name="chain"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1561">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/v6.0.0/index.js#L1571">chain :: Chain m => (a -> m b, m a) -> m b</a></code></h4> | ||
@@ -784,3 +795,3 @@ Function wrapper for [`fantasy-land/chain`][]. | ||
<h4 name="join"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1582">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.0.0/index.js#L1592">join :: Chain m => m (m a) -> m a</a></code></h4> | ||
@@ -802,3 +813,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/v5.2.0/index.js#L1602">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.0.0/index.js#L1612">chainRec :: ChainRec m => (TypeRep m, (a -> c, b -> c, a) -> m c, a) -> m b</a></code></h4> | ||
@@ -820,3 +831,3 @@ Function wrapper for [`fantasy-land/chainRec`][]. | ||
<h4 name="filter"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1622">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.0.0/index.js#L1632">filter :: (Applicative f, Foldable f, Monoid (f a)) => (a -> Boolean, f a) -> f a</a></code></h4> | ||
@@ -838,3 +849,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/v5.2.0/index.js#L1645">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.0.0/index.js#L1655">filterM :: (Alternative m, Monad m) => (a -> Boolean, m a) -> m a</a></code></h4> | ||
@@ -865,3 +876,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/v5.2.0/index.js#L1676">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.0.0/index.js#L1686">alt :: Alt f => (f a, f a) -> f a</a></code></h4> | ||
@@ -887,3 +898,3 @@ Function wrapper for [`fantasy-land/alt`][]. | ||
<h4 name="zero"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1700">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.0.0/index.js#L1710">zero :: Plus f => TypeRep f -> f a</a></code></h4> | ||
@@ -906,3 +917,3 @@ Function wrapper for [`fantasy-land/zero`][]. | ||
<h4 name="reduce"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1721">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.0.0/index.js#L1731">reduce :: Foldable f => ((b, a) -> b, b, f a) -> b</a></code></h4> | ||
@@ -922,3 +933,3 @@ Function wrapper for [`fantasy-land/reduce`][]. | ||
<h4 name="traverse"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1739">traverse :: (Applicative f, Traversable t) => (TypeRep f, a -> f b, t a) -> f (t b)</a></code></h4> | ||
<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> | ||
@@ -940,3 +951,3 @@ Function wrapper for [`fantasy-land/traverse`][]. | ||
<h4 name="sequence"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1759">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.0.0/index.js#L1769">sequence :: (Applicative f, Traversable t) => (TypeRep f, t (f a)) -> f (t a)</a></code></h4> | ||
@@ -955,3 +966,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/v5.2.0/index.js#L1776">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.0.0/index.js#L1786">extend :: Extend w => (w a -> b, w a) -> w b</a></code></h4> | ||
@@ -964,7 +975,7 @@ Function wrapper for [`fantasy-land/extend`][]. | ||
```javascript | ||
> extend(xs => xs.length, ['foo', 'bar', 'baz', 'quux']) | ||
[4] | ||
> extend(ss => ss.join(''), ['x', 'y', 'z']) | ||
['xyz', 'yz', 'z'] | ||
``` | ||
<h4 name="extract"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1791">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.0.0/index.js#L1801">extract :: Comonad w => w a -> a</a></code></h4> | ||
@@ -978,3 +989,3 @@ Function wrapper for [`fantasy-land/extract`][]. | ||
<h4 name="contramap"><code><a href="https://github.com/sanctuary-js/sanctuary-type-classes/blob/v5.2.0/index.js#L1803">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.0.0/index.js#L1813">contramap :: Contravariant f => (b -> a, f a) -> f b</a></code></h4> | ||
@@ -981,0 +992,0 @@ Function wrapper for [`fantasy-land/contramap`][]. |
91734
1772
989