Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "lists", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "A library of higher-order functions modeled after Haskell's Data.List module", | ||
@@ -22,3 +22,5 @@ "main": "lists.js", | ||
"array", | ||
"collection" | ||
"collection", | ||
"underscore", | ||
"prelude" | ||
], | ||
@@ -25,0 +27,0 @@ "author": "Kurt Medley <kurtdmedley@gmail.com>", |
127
README.md
@@ -32,6 +32,6 @@ # [ l [ i [ s ] t ] s ] | ||
C{ **arr|str -> [x]** } Pseudo type signature | ||
C{ **[x]|str -> [x]** } Pseudo type signature | ||
tail : arr|str -> [x] | ||
- Takes an Array of Variables or String and produces an Array of Variables ([x]). | ||
tail : [x]|str -> [x] | ||
- Takes an Array of Variables or a String and produces an Array of Variables ([x]). | ||
@@ -107,4 +107,4 @@ map : [x] -> f -> [x] | ||
* [`dropWhile`](#dropWhile) : f -> [x]|str -> [x] | ||
* [`span`](#span) : arr|str -> f -> [[x], [x]|str] | ||
* [`break`](#break) : arr|str -> f -> [[x], [x]|str] | ||
* [`span`](#span) : [x]|str -> f -> [[x], [x]|str] | ||
* [`break`](#break) : [x]|str -> f -> [[x], [x]|str] | ||
* [`stripPrefix`](#stripPrefix) : [num]|str -> [num]|str -> [num]|[str] | ||
@@ -156,6 +156,6 @@ * [`group`](#group) : [num]|str -> [[num]]|[[str]] | ||
* lines : String -> [String] | ||
* words : String -> [String] | ||
* unlines : [String] -> String | ||
* unwords : [String] -> String | ||
* [`lines`](#lines) : str -> [str] | ||
* [`words`](#words) : str -> [str] | ||
* [`unlines`](#unlines) : [str] -> str | ||
* [`unwords`](#unwords) : [str] -> str | ||
* nub : Eq a => [a] -> [a] | ||
@@ -280,3 +280,3 @@ * delete : Eq a => a -> [a] -> [a] | ||
------ | ||
**Description**: Test if an Array of Variables or String is empty. | ||
**Description**: Test if an Array of Variables or a String is empty. | ||
@@ -403,3 +403,3 @@ **Signature Definition**: Give arg 1 an Array of Variables or a String; Get a boolean. | ||
------ | ||
**Description**: Variable returned reducing left to right by applying a binary operator Function (f) on a starting Variable (x), known as the accumulator, and an Array of Variables or String. | ||
**Description**: Variable returned reducing left to right by applying a binary operator Function (f) on a starting Variable (x), known as the accumulator, and an Array of Variables or a String. | ||
@@ -419,3 +419,3 @@ **Signature Definition**: Give arg 1 a starting Variable (usually a left identity of the binary operator). Give arg 2 an Array of Variables or a String. Give arg 3 a Function (binary operator). Get a Variable. | ||
------ | ||
**Description**: Variant of foldl without a starting Variable (The accumulator begins with the 0th index of the passed Array of Variables or String). Use with non-empty Arrays or Strings. | ||
**Description**: Variant of foldl without a starting Variable (The accumulator begins with the 0th index of the passed Array of Variables or a String). Use with non-empty Arrays or Strings. | ||
@@ -434,3 +434,3 @@ **Signature Definition**: Give arg 1 an Array of Variables or a String. Give arg 2 a Function (binary operator). Get a Variable. | ||
------ | ||
**Description**: Variable returned reducing right to left by applying a binary operator Function (f) on a starting Variable (x), known as the accumulator, and an Array of Variables or String. | ||
**Description**: Variable returned reducing right to left by applying a binary operator Function (f) on a starting Variable (x), known as the accumulator, and an Array of Variables or a String. | ||
@@ -451,3 +451,3 @@ **Signature Definition**: Give arg 1 a starting Variable (usually a right identity of the binary operator). Give arg 2 an Array of Variables or a String. Give arg 3 a Function (binary operator). Get a Variable. | ||
------ | ||
**Description**: Variant of foldr without a starting Variable (The accumulator begins with the 0th index of the passed Array or String). Use with non-empty Arrays or Strings. | ||
**Description**: Variant of foldr without a starting Variable (The accumulator begins with the 0th index of the passed Array or a String). Use with non-empty Arrays or Strings. | ||
@@ -466,3 +466,3 @@ **Signature Definition**: Give arg 1 an Array of Variables or a String. Give arg 2 a Function (binary operator). Get a Variable. | ||
------ | ||
**Description**: Flatten an Array of an Array of Variables or an Array of Strings into an Array of Variables or String respectively. | ||
**Description**: Flatten an Array of an Array of Variables or an Array of Strings into an Array of Variables or a String respectively. | ||
@@ -481,5 +481,5 @@ **Signature Definition**: Give arg 1 an Array of an Array of Variables or an Array of Strings. Get an Array of Variables or a String. | ||
------ | ||
**Description**: Array of Variables or String returned by mapping a Function over an Array of Variables or String and flattening the result. | ||
**Description**: Array of Variables or a String returned by mapping a Function over an Array of Variables or a String and flattening the result. | ||
**Signature Definition**: Give arg 1 an Array of Variables or a String. Give arg 2 a Function that produces an Array of Variables or String. Get an Array of Variables or a String. | ||
**Signature Definition**: Give arg 1 an Array of Variables or a String. Give arg 2 a Function that produces an Array of Variables or a String. Get an Array of Variables or a String. | ||
@@ -542,3 +542,3 @@ **Example Usage**: | ||
------ | ||
**Description**: Boolean returned by applying a predicate Function to each element in an Array of Variables or String. True if all f(x) are true. False if any f(x) are false. | ||
**Description**: Boolean returned by applying a predicate Function to each element in an Array of Variables or a String. True if all f(x) are true. False if any f(x) are false. | ||
@@ -769,3 +769,3 @@ **Signature Definition**: Give arg 1 an Array of Variables or a String. Give arg 2 a predicate Function to be applied to each element of arg 1. Get a boolean. | ||
------ | ||
**Description**: Array of Variables returned by taking the first n (num) elements from [x] or String. | ||
**Description**: Array of Variables returned by taking the first n (num) elements from [x] or a String. | ||
@@ -784,3 +784,3 @@ **Signature Definition**: Give arg 1 a Number. Give arg 2 an Array of Variables or a String. Get an Array of Variables. | ||
------ | ||
**Description**: Array of Variables returned by dropping the first n (num) elements from [x] or String. | ||
**Description**: Array of Variables returned by dropping the first n (num) elements from [x] or a String. | ||
@@ -799,3 +799,3 @@ **Signature Definition**: Give arg 1 a Number. Give arg 2 an Array of Variables or a String. Get an Array of Variables. | ||
------ | ||
**Description**: Array of two Arrays returned. The first Array contains the first n elements of the supplied Array of Variables or String. The second contains the rest. | ||
**Description**: Array of two Arrays returned. The first Array contains the first n elements of the supplied Array of Variables or a String. The second contains the rest. | ||
@@ -842,7 +842,7 @@ **Signature Definition**: Give arg 1 a Number. Give arg 2 an Array of Variables or a String. Get an Array of two Arrays of Variables. | ||
<a name='span'/> | ||
### span : arr|str -> f -> [[x], [x]|str] | ||
### span : [x]|str -> f -> [[x], [x]|str] | ||
------ | ||
**Description**: An Array of an Array of Variables and Array of Variables or a String (psuedo-tuple) is returned. The first element is the longest prefix of an Array of Variables or a String that satisfy a predicate Function f. The second element is the rest of the list. | ||
**Signature Definition**: Give arg 1 an Array of Variables or String. Give arg 2 a Function. Get an Array of an Array of Variables and Array of Variables or a String (psuedo-tuple). | ||
**Signature Definition**: Give arg 1 an Array of Variables or a String. Give arg 2 a Function. Get an Array of an Array of Variables and Array of Variables or a String (psuedo-tuple). | ||
@@ -858,3 +858,3 @@ **Example Usage**: | ||
<a name='break'/> | ||
### break : arr|str -> f -> [[x], [x]|str] | ||
### break : [x]|str -> f -> [[x], [x]|str] | ||
------ | ||
@@ -878,3 +878,3 @@ **Description**: An Array of an Array of Variables and Array of Variables or a String (psuedo-tuple) is returned. The first element is the longest prefix of an Array of Variables or a String that do not satisfy a predicate Function f. The second element is the rest of the list. | ||
**Signature Definition**: Give arg 1 an Array of Numbers or String. Give arg 2 an Array of Numbers or String. Get an Array of Numbers or an Array of Strings. | ||
**Signature Definition**: Give arg 1 an Array of Numbers or a String. Give arg 2 an Array of Numbers or a String. Get an Array of Numbers or an Array of Strings. | ||
@@ -935,5 +935,5 @@ **Example Usage**: | ||
------ | ||
**Description**: Test if an Array of Numbers or String is the prefix of an Array of Numbers or a String. The arguments must be of the same type. | ||
**Description**: Test if an Array of Numbers or a String is the prefix of an Array of Numbers or a String. The arguments must be of the same type. | ||
**Signature Definition**: Give arg 1 an Array of Numbers or String. Give arg 2 an Array of Numbers or a String. Get a boolean. | ||
**Signature Definition**: Give arg 1 an Array of Numbers or a String. Give arg 2 an Array of Numbers or a String. Get a boolean. | ||
@@ -951,5 +951,5 @@ **Example Usage**: | ||
------ | ||
**Description**: Test if an Array of Numbers or String is the suffix of an Array of Numbers or a String. The arguments must be of the same type. | ||
**Description**: Test if an Array of Numbers or a String is the suffix of an Array of Numbers or a String. The arguments must be of the same type. | ||
**Signature Definition**: Give arg 1 an Array of Numbers or String. Give arg 2 an Array of Numbers or a String. Get a boolean. | ||
**Signature Definition**: Give arg 1 an Array of Numbers or a String. Give arg 2 an Array of Numbers or a String. Get a boolean. | ||
@@ -982,5 +982,5 @@ **Example Usage**: | ||
------ | ||
**Description**: Test if an Array of Numbers or String is the subsequence of an Array of Numbers or a String. The arguments must be of the same type. | ||
**Description**: Test if an Array of Numbers or a String is the subsequence of an Array of Numbers or a String. The arguments must be of the same type. | ||
**Signature Definition**: Give arg 1 an Array of Numbers or String. Give arg 2 an Array of Numbers or a String. Get a boolean. | ||
**Signature Definition**: Give arg 1 an Array of Numbers or a String. Give arg 2 an Array of Numbers or a String. Get a boolean. | ||
@@ -998,5 +998,5 @@ **Example Usage**: | ||
------ | ||
**Description**: Test if the Number or String is in the Array of Numbers or a String. | ||
**Description**: Test if the Number or a String is in the Array of Numbers or a String. | ||
**Signature Definition**: Give arg 1 a Number or String. Give arg 2 an Array of Numbers or a String. Get a boolean. | ||
**Signature Definition**: Give arg 1 a Number or a String. Give arg 2 an Array of Numbers or a String. Get a boolean. | ||
@@ -1013,5 +1013,5 @@ **Example Usage**: | ||
------ | ||
**Description**: Test if the Number or String is not in the Array of Numbers or a String. | ||
**Description**: Test if the Number or a String is not in the Array of Numbers or a String. | ||
**Signature Definition**: Give arg 1 a Number or String. Give arg 2 an Array of Numbers or a String. Get a boolean. | ||
**Signature Definition**: Give arg 1 a Number or a String. Give arg 2 an Array of Numbers or a String. Get a boolean. | ||
@@ -1030,3 +1030,3 @@ **Example Usage**: | ||
**Signature Definition**: Give arg 1 a Number or String. Give arg 2 an Array of an Array containing a Number or String as the key and a Variable as the value. Get a Variable (value). | ||
**Signature Definition**: Give arg 1 a Number or a String. Give arg 2 an Array of an Array containing a Number or a String as the key and a Variable as the value. Get a Variable (value). | ||
@@ -1181,3 +1181,3 @@ **Example Usage**: | ||
**Signature Definition**: Give arg 1 an Array of an Array of Variables. Give arg 2 a binary Function. Get an Array of Variables. | ||
**Signature Definition**: Give arg 1 an Array of an Array of Variables. Give arg 2 a Function. Get an Array of Variables. | ||
@@ -1199,1 +1199,54 @@ **Example Usage**: | ||
------ | ||
<a name='lines'/> | ||
### lines : str -> [str] | ||
------ | ||
**Description**: Returns an Array of Strings as the result of breaking a String at each new line character (\u000A). The resultant Array does not contain any new line characters. | ||
**Signature Definition**: Give arg 1 a String. Get an Array of Strings. | ||
**Example Usage**: | ||
```js | ||
lists.lines("l\no\nl"); /* ["l","o","l"] */ | ||
lists.lines("Hey\nthere"); /* ["Hey","there"] */ | ||
``` | ||
------ | ||
<a name='words'/> | ||
### words : str -> [str] | ||
------ | ||
**Description**: Returns an Array of Strings as the result of breaking a String at each space character (\u0020). The resultant Array does not contain any space characters. | ||
**Signature Definition**: Give arg 1 a String. Get an Array of Strings. | ||
**Example Usage**: | ||
```js | ||
lists.words("break it up"); /* ["break","it","up"] */ | ||
``` | ||
------ | ||
<a name='unlines'/> | ||
### unlines : [str] -> str | ||
------ | ||
**Description**: Returns a String with a new line character appended to each String of the Array that it joins. | ||
**Signature Definition**: Give arg 1 an Array of Strings. Get a String. | ||
**Example Usage**: | ||
```js | ||
lists.unlines(["break","it","up"]); /* "break\nit\nup\n" */ | ||
``` | ||
------ | ||
<a name='unwords'/> | ||
### unwords : [str] -> str | ||
------ | ||
**Description**: Returns a String with a space character appended to each String of the Array that it joins. | ||
**Signature Definition**: Give arg 1 an Array of Strings. Get a String. | ||
**Example Usage**: | ||
```js | ||
lists.unwords(["break","it","up"]); /* "break it up " */ | ||
``` | ||
------ |
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
59085
1228