Comparing version 0.1.95 to 0.1.96
{ | ||
"name": "lists", | ||
"version": "0.1.95", | ||
"version": "0.1.96", | ||
"description": "A library of higher-order functions modeled after Haskell's Data.List module", | ||
@@ -5,0 +5,0 @@ "main": "lists.js", |
@@ -177,5 +177,5 @@ # [ l [ i [ s ] t ] s ] | ||
* [`sortBy`](#sortBy) : [x]|str -> f -> [x] | ||
* insertBy : (a -> a -> Ordering) -> a -> [a] -> [a] | ||
* maximumBy : (a -> a -> Ordering) -> [a] -> a | ||
* minimumBy : (a -> a -> Ordering) -> [a] -> a | ||
* [`insertBy`](#insertBy) : x -> [x]|str -> f -> [x] | ||
* [`maximumBy`](#maximumBy) : [x]|str -> f -> x | ||
* [`minimumBy`](#minimumBy) : [x]|str -> f -> x | ||
@@ -194,4 +194,3 @@ ----- | ||
* flip : | ||
* compare : | ||
* GT,LT,EQ : | ||
* GT,LT,EQ,compare : | ||
* bubbleSort : | ||
@@ -1439,1 +1438,51 @@ * mergeSort : | ||
------ | ||
<a name='insertBy'/> | ||
### insertBy : x -> [x]|str -> f -> [x] | ||
------ | ||
**Description**: Inserts an element into the first position of the Array of Variables based on the user supplied Ordering Function. | ||
**Signature Definition**: Give arg 1 a Variable. Give arg 2 an Array of Variables or a String. Give arg 3 a Function. Get an Array of Variables. | ||
**Example Usage**: | ||
```js | ||
function fn(x,y) { | ||
return (x+y) < (x*y) ? 'LT' : 'GT' | ||
} | ||
lists.insertBy(4, [0,1,3,5,7,9], fn); /* [0,1,4,3,5,7,9] */ | ||
``` | ||
------ | ||
<a name='maximumBy'/> | ||
### maximumBy : [x]|str -> f -> x | ||
------ | ||
**Description**: The largest element of a non-empty Array of Variables or a String where the definition of "largest" comes from the user supplied Ordering function. | ||
**Signature Definition**: Give arg 1 a Variable. Give arg 2 an Array of Variables or a String. Give arg 3 a Function. Get an Array of Variables. | ||
**Example Usage**: | ||
```js | ||
lists.maximumBy([[1,3],[2]], lists.compare); /* [2] */ | ||
function compareLength(x,y) { | ||
return x.length > y.length ? 'GT' : 'LT' | ||
} | ||
lists.maximumBy([[1,3],[2]], compareLength); /* [1,3] */ | ||
``` | ||
------ | ||
<a name='minimumBy'/> | ||
### minimumBy : [x]|str -> f -> x | ||
------ | ||
**Description**: The least element of a non-empty Array of Variables or a String where the definition of "least" comes from the user supplied Ordering function. | ||
**Signature Definition**: Give arg 1 a Variable. Give arg 2 an Array of Variables or a String. Give arg 3 a Function. Get an Array of Variables. | ||
**Example Usage**: | ||
```js | ||
lists.minimumBy([[1,3],[2]], lists.compare); /* [1,3] */ | ||
function compareLength(x,y) { | ||
return x.length > y.length ? 'GT' : 'LT' | ||
} | ||
lists.minimumBy([[1,3],[2],[]], compareLength); /* [] */ | ||
``` | ||
------ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69379
1486