extra-iterable
Version:
An iterable is a sequence of values.
1,153 lines (1,142 loc) โข 45.1 kB
TypeScript
/**
* End of iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/END)
*/
declare const END: number;
/**
* Handle reading of a single value.
* [๐](https://github.com/nodef/extra-iterable/wiki/ReadFunction)
* @returns value
*/
type ReadFunction<T> = () => T;
/**
* Handle combining of two values.
* [๐](https://github.com/nodef/extra-iterable/wiki/CombineFunction)
* @param a a value
* @param b another value
* @returns combined value
*/
type CombineFunction<T> = (a: T, b: T) => T;
/**
* Handle comparison of two values.
* [๐](https://github.com/nodef/extra-iterable/wiki/CompareFunction)
* @param a a value
* @param b another value
* @returns a<b: -ve, a=b: 0, a>b: +ve
*/
type CompareFunction<T> = (a: T, b: T) => number;
/**
* Handle processing of values in an iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/ProcessFunction)
* @param v value in iterable
* @param i index of value in iterable
* @param x iterable containing the value
*/
type ProcessFunction<T> = (v: T, i: number, x: Iterable<T>) => void;
/**
* Handle selection of values in an iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/TestFunction)
* @param v value in iterable
* @param i index of value in iterable
* @param x iterable containing the value
* @returns selected?
*/
type TestFunction<T> = (v: T, i: number, x: Iterable<T>) => boolean;
/**
* Handle transformation of a value to another.
* [๐](https://github.com/nodef/extra-iterable/wiki/MapFunction)
* @param v value in iterable
* @param i index of value in iterable
* @param x iterable containing the value
* @returns transformed value
*/
type MapFunction<T, U> = (v: T, i: number, x: Iterable<T>) => U;
/**
* Handle reduction of multiple values into a single value.
* [๐](https://github.com/nodef/extra-iterable/wiki/ReduceFunction)
* @param acc accumulator (temporary result)
* @param v value in iterable
* @param i index of value in iterable
* @param x iterable containing the value
* @returns reduced value
*/
type ReduceFunction<T, U> = (acc: U, v: T, i: number, x: Iterable<T>) => U;
/**
* Handle ending of a combined iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/EndFunction)
* @param dones iแตสฐ iterable done?
* @returns combined iterable done?
*/
type EndFunction = (dones: boolean[]) => boolean;
/**
* Check if value is an iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/is)
* @param v a value
* @returns v is iterable?
*/
declare function is(v: any): v is Iterable<any>;
/**
* Check if value is an iterator.
* [๐](https://github.com/nodef/extra-iterable/wiki/isIterator)
* @param v a value
* @returns v implements \{next(), return?(), throw?()\}?
*/
declare function isIterator(v: any): v is Iterator<any>;
/**
* Check if value is a list (iterable & !string).
* [๐](https://github.com/nodef/extra-iterable/wiki/isList)
* @param v a value
* @returns v is list?
*/
declare function isList<T>(v: Iterable<T>): boolean;
/**
* Get iterator of an iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/iterator)
* @param x an iterable
* @returns x\[\<iterator\>\]()
*/
declare function iterator<T>(x: Iterable<T>): Iterator<T>;
/**
* List all indices.
* [๐](https://github.com/nodef/extra-iterable/wiki/keys)
* @param x an iterable
* @returns 0, 1, ..., |x|-1
*/
declare function keys<T>(x: Iterable<T>): IterableIterator<number>;
/**
* List all values.
* [๐](https://github.com/nodef/extra-iterable/wiki/values)
* @param x an iterable
* @returns vโ, vโ, ... | vแตข = x[i]
*/
declare function values<T>(x: Iterable<T>): IterableIterator<T>;
/**
* List all index-value pairs.
* [๐](https://github.com/nodef/extra-iterable/wiki/entries)
* @param x an iterable
* @returns [0, vโ], [1, vโ], ... | vแตข = x[i]
*/
declare function entries<T>(x: Iterable<T>): IterableIterator<[number, T]>;
/**
* Convert an iterable-like to iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/from)
* @param x an iterator/iterable
* @returns x as iterable
*/
declare function from<T>(x: Iterator<T> | Iterable<T>): Iterable<T>;
/**
* Convert an iterator to iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/fromIterator)
* @param x an iterator/iterable
* @returns x as iterable
*/
declare function fromIterator<T>(x: Iterator<T>): Iterable<T>;
/**
* Generate iterable from given number range.
* [๐](https://github.com/nodef/extra-iterable/wiki/fromRange)
* @param v start number [0]
* @param V stop number, excluding [END]
* @param dv step size [1]
* @returns v, v+dv, v+2dv, ...
*/
declare function fromRange(v?: number, V?: number, dv?: number): IterableIterator<number>;
/**
* Generate iterable from repeated function invocation.
* [๐](https://github.com/nodef/extra-iterable/wiki/fromInvocation)
* @param fn function (impure)
* @param args arguments
* @returns fn(...args), fn(...args), ...
*/
declare function fromInvocation<T>(fn: Function, ...args: any[]): IterableIterator<T>;
/**
* Generate iterable from repeated function application.
* [๐](https://github.com/nodef/extra-iterable/wiki/fromApplication)
* @param fm map function (v, i)
* @param v start value
* @returns v, fm(v), fm(fm(v)), ...
*/
declare function fromApplication<T>(fm: MapFunction<T, T>, v: T): IterableIterator<T>;
/**
* Check if an iterable can iterated only once.
* [๐](https://github.com/nodef/extra-iterable/wiki/isOnce)
* @param x an iterable
* @returns x\[\<iterator\>\] = x?
*/
declare function isOnce<T>(x: Iterable<T>): x is IterableIterator<T>;
/**
* Check if an iterable can be iterated many times.
* [๐](https://github.com/nodef/extra-iterable/wiki/isMany)
* @param x an iterable
* @returns x\[\<iterator\>\] โ x?
*/
declare function isMany<T>(x: Iterable<T>): x is Iterable<T>;
/**
* Convert a once-like iterable to many.
* [๐](https://github.com/nodef/extra-iterable/wiki/toMany)
* @param x an iterable
* @param now consume immediately? [false]
* @returns x' | x' = x; x' can be iterated multiple times
*/
declare function toMany<T>(x: Iterable<T>, now?: boolean): Iterable<T>;
/**
* Generate a function that iterates over values upon invocation.
* [๐](https://github.com/nodef/extra-iterable/wiki/toInvokable)
* @param x an iterable
* @returns fn | fn() โ x[0], fn() โ x[1], ...
*/
declare function toInvokable<T>(x: Iterable<T>): () => T;
/**
* Check if an iterable is empty.
* [๐](https://github.com/nodef/extra-iterable/wiki/isEmpty)
* @param x an iterable
* @returns |x| = 0?
*/
declare function isEmpty<T>(x: Iterable<T>): boolean;
/**
* Find the length of an iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/length)
* @param x an iterable
* @param i start index [0]
* @param I end index [END]
* @returns |x[i..I]|
*/
declare function length<T>(x: Iterable<T>, i?: number, I?: number): number;
/**
* Get zero-based index for element in iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/index)
* @param x an iterable
* @param i index (-ve: from right)
* @returns i' | x[i'] = x[i]; i' โ [0, |x|]
*/
declare function index<T>(x: Iterable<T>, i: number): number;
/**
* Get index range for part of iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/indexRange)
* @param x an iterable
* @param i start index (-ve: from right) [0]
* @param I end index (-ve: from right) [END]
* @returns [i', I'] | i' โค I'; i', I' โ [0, |x|]
*/
declare function indexRange<T>(x: Iterable<T>, i?: number, I?: number): [number, number];
/**
* Compare two iterables.
* [๐](https://github.com/nodef/extra-iterable/wiki/compare)
* @param x an iterable
* @param y another iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x<y: -1, x=y: 0, x>y: 1
*/
declare function compare<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): number;
/**
* Check if two iterables are equal.
* [๐](https://github.com/nodef/extra-iterable/wiki/isEqual)
* @param x an iterable
* @param y another iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x=y?
*/
declare function isEqual<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): boolean;
/**
* Get value at index.
* [๐](https://github.com/nodef/extra-iterable/wiki/get)
* @param x an iterable
* @param i index
* @returns x[i]
*/
declare function get<T>(x: Iterable<T>, i: number): T;
/**
* Get values at indices.
* [๐](https://github.com/nodef/extra-iterable/wiki/getAll)
* @param x an iterable
* @param is indices (sorted)
* @returns x[iโ], x[iโ], ... | [iโ, iโ, ...] = is
*/
declare function getAll<T>(x: Iterable<T>, is: number[]): IterableIterator<T>;
/**
* Get value at path in a nested iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/getPath)
* @param x a nested iterable
* @param p path
* @returns x[iโ][iโ][...] | [iโ, iโ, ...] = p
*/
declare function getPath(x: Iterable<any>, p: number[]): any;
/**
* Check if nested iterable has a path.
* [๐](https://github.com/nodef/extra-iterable/wiki/hasPath)
* @param x a nested iterable
* @param p path
* @returns x[iโ][iโ][...] exists? | [iโ, iโ, ...] = p
*/
declare function hasPath(x: Iterable<any>, p: number[]): boolean;
/**
* Set value at index.
* [๐](https://github.com/nodef/extra-iterable/wiki/set)
* @param x an iterable
* @param i index
* @param v value
* @returns x' | x' = x; x'[i] = v
*/
declare function set<T>(x: Iterable<T>, i: number, v: T): IterableIterator<T>;
/**
* Exchange two values.
* [๐](https://github.com/nodef/extra-iterable/wiki/swap)
* @param x an iterable
* @param i an index
* @param j another index
* @returns x' | x' = x; x'[i] = x[j]; x'[j] = x[i]
*/
declare function swap<T>(x: Iterable<T>, i: number, j: number): IterableIterator<T>;
/**
* Remove value at index.
* [๐](https://github.com/nodef/extra-iterable/wiki/remove)
* @param x an iterable
* @param i index
* @returns x[0..i] โงบ x[i+1..]
*/
declare function remove<T>(x: Iterable<T>, i: number): IterableIterator<T>;
/**
* Count values which satisfy a test.
* [๐](https://github.com/nodef/extra-iterable/wiki/count)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns ฮฃtแตข | tแตข = 1 if ft(vแตข) else 0; vแตข โ x
*/
declare function count<T>(x: Iterable<T>, ft: TestFunction<T>): number;
/**
* Count occurrences of values.
* [๐](https://github.com/nodef/extra-iterable/wiki/countAs)
* @param x an array
* @param fm map function (v, i, x)
* @returns Map \{value โ count\}
*/
declare function countAs<T, U = T>(x: Iterable<T>, fm?: MapFunction<T, T | U> | null): Map<T | U, number>;
/**
* Find smallest value.
* [๐](https://github.com/nodef/extra-iterable/wiki/min)
* @param x an iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns v | v โค vแตข; vแตข โ x
*/
declare function min<T, U = T>(x: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): T;
/**
* Find largest value.
* [๐](https://github.com/nodef/extra-iterable/wiki/max)
* @param x an iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns v | v โฅ vแตข; vแตข โ x
*/
declare function max<T, U = T>(x: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): T;
/**
* Find smallest and largest values.
* [๐](https://github.com/nodef/extra-iterable/wiki/range)
* @param x an iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns [min_value, max_value]
*/
declare function range<T, U = T>(x: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): [T, T];
/**
* Find smallest entry.
* [๐](https://github.com/nodef/extra-iterable/wiki/minEntry)
* @param x an iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns [min_index, min_value]
*/
declare function minEntry<T, U = T>(x: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): [number, T];
/**
* Find largest entry.
* [๐](https://github.com/nodef/extra-iterable/wiki/maxEntry)
* @param x an iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns [max_index, max_value]
*/
declare function maxEntry<T, U = T>(x: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): [number, T];
/**
* Find smallest and largest entries.
* [๐](https://github.com/nodef/extra-iterable/wiki/rangeEntries)
* @param x an iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns [min_entry, max_entry]
*/
declare function rangeEntries<T, U = T>(x: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): [[number, T], [number, T]];
/**
* Get part of an iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/slice)
* @param x an iterable
* @param i start index (-ve: from right) [0]
* @param I end index (-ve: from right) [END]
* @returns x[i..I]
*/
declare function slice<T>(x: Iterable<T>, i?: number, I?: number): IterableIterator<T>;
/**
* Get first value.
* [๐](https://github.com/nodef/extra-iterable/wiki/head)
* @param x an iterable
* @param vd default value
* @returns x[0] || vd
*/
declare function head<T>(x: Iterable<T>, vd?: T): T;
/**
* Get last value.
* [๐](https://github.com/nodef/extra-iterable/wiki/last)
* @param x an iterable
* @param vd default value
* @returns x[|x|-1]
*/
declare function last<T>(x: Iterable<T>, vd?: T): T;
/**
* Get values except first.
* [๐](https://github.com/nodef/extra-iterable/wiki/tail)
* @param x an iterable
* @returns x[1..|x|]
*/
declare function tail<T>(x: Iterable<T>): IterableIterator<T>;
/**
* Get values except last.
* [๐](https://github.com/nodef/extra-iterable/wiki/init)
* @param x an iterable
* @returns x[0..|x|-1]
*/
declare function init<T>(x: Iterable<T>): IterableIterator<T>;
/**
* Get values from left.
* [๐](https://github.com/nodef/extra-iterable/wiki/left)
* @param x an iterable
* @param n number of values
* @returns x[0..n]
*/
declare function left<T>(x: Iterable<T>, n: number): IterableIterator<T>;
/**
* Get values from right.
* [๐](https://github.com/nodef/extra-iterable/wiki/right)
* @param x an iterable
* @param n number of values
* @returns x[-n..]
*/
declare function right<T>(x: Iterable<T>, n: number): IterableIterator<T>;
/**
* Get values from middle.
* [๐](https://github.com/nodef/extra-iterable/wiki/middle)
* @param x an iterable
* @param i start index
* @param n number of values [1]
* @returns x[i..i+n]
*/
declare function middle<T>(x: Iterable<T>, i: number, n?: number): IterableIterator<T>;
/**
* Keep first n values only.
* [๐](https://github.com/nodef/extra-iterable/wiki/take)
* @param x an iterable
* @param n number of values [1]
* @returns x[0..n]
*/
declare function take<T>(x: Iterable<T>, n?: number): IterableIterator<T>;
/**
* Keep last n values only.
* [๐](https://github.com/nodef/extra-iterable/wiki/takeRight)
* @param x an iterable
* @param n number of values [1]
* @returns x[-n..]
*/
declare function takeRight<T>(x: Iterable<T>, n?: number): IterableIterator<T>;
/**
* Keep values from left, while a test passes.
* [๐](https://github.com/nodef/extra-iterable/wiki/takeWhile)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns x[0..T-1] | ft(x[i]) = true โ i โ [0, T-1] & ft(x[T]) = false
*/
declare function takeWhile<T>(x: Iterable<T>, ft: TestFunction<T>): IterableIterator<T>;
/**
* Keep values from right, while a test passes.
* [๐](https://github.com/nodef/extra-iterable/wiki/takeWhileRight)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns x[T..] | ft(x[i]) = true โ i โ [T, |x|-1] & ft(x[T-1]) = false
*/
declare function takeWhileRight<T>(x: Iterable<T>, ft: TestFunction<T>): IterableIterator<T>;
/**
* Discard first n values only.
* [๐](https://github.com/nodef/extra-iterable/wiki/drop)
* @param x an iterable
* @param n number of values [1]
* @returns x[n..]
*/
declare function drop<T>(x: Iterable<T>, n?: number): IterableIterator<T>;
/**
* Discard last n values only.
* [๐](https://github.com/nodef/extra-iterable/wiki/dropRight)
* @param x an iterable
* @param n number of values [1]
* @returns x[0..-n]
*/
declare function dropRight<T>(x: Iterable<T>, n?: number): IterableIterator<T>;
/**
* Discard values from left, while a test passes.
* [๐](https://github.com/nodef/extra-iterable/wiki/dropWhile)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns x[T..] | ft(x[i]) = true โ i โ [0, T-1] & ft(x[T]) = false
*/
declare function dropWhile<T>(x: Iterable<T>, ft: TestFunction<T>): IterableIterator<T>;
/**
* Discard values from right, while a test passes.
* [๐](https://github.com/nodef/extra-iterable/wiki/dropWhileRight)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns x[0..T-1] | ft(x[i]) = true โ i โ [T, |x|-1] & ft(x[T-1]) = false
*/
declare function dropWhileRight<T>(x: Iterable<T>, ft: TestFunction<T>): IterableIterator<T>;
/**
* Check if iterable has a value.
* [๐](https://github.com/nodef/extra-iterable/wiki/includes)
* @param x an iterable
* @param v search value
* @param i start index [0]
* @returns v โ x[i..]?
*/
declare function includes<T>(x: Iterable<T>, v: T, i?: number): boolean;
/**
* Find first index of a value.
* [๐](https://github.com/nodef/extra-iterable/wiki/indexOf)
* @param x an iterable
* @param v search value
* @param i start index [0]
* @returns index of v in x[i..] if found else -1
*/
declare function indexOf<T>(x: Iterable<T>, v: T, i?: number): number;
/**
* Find last index of a value.
* [๐](https://github.com/nodef/extra-iterable/wiki/lastIndexOf)
* @param x an iterable
* @param v search value
* @param i start index [END-1]
* @returns last index of v in x[0..i] if found else -1
*/
declare function lastIndexOf<T>(x: Iterable<T>, v: T, i?: number): number;
/**
* Find first value passing a test.
* [๐](https://github.com/nodef/extra-iterable/wiki/find)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns first v | ft(v) = true; v โ x
*/
declare function find<T>(x: Iterable<T>, ft: TestFunction<T>): T;
/**
* Find last value passing a test.
* [๐](https://github.com/nodef/extra-iterable/wiki/findRight)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns last v | ft(v) = true; v โ x
*/
declare function findRight<T>(x: Iterable<T>, ft: TestFunction<T>): T;
/**
* Scan from left, while a test passes.
* [๐](https://github.com/nodef/extra-iterable/wiki/scanWhile)
* @param x an array
* @param ft test function (v, i, x)
* @returns first index where test fails
*/
declare function scanWhile<T>(x: Iterable<T>, ft: TestFunction<T>): number;
/**
* Scan from right, while a test passes.
* [๐](https://github.com/nodef/extra-iterable/wiki/scanWhileRight)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns first index where test passes till end
*/
declare function scanWhileRight<T>(x: Iterable<T>, ft: TestFunction<T>): number;
/**
* Scan from left, until a test passes.
* [๐](https://github.com/nodef/extra-iterable/wiki/scanUntil)
* @param x an array
* @param ft test function (v, i, x)
* @returns first index where test passes
*/
declare function scanUntil<T>(x: Iterable<T>, ft: TestFunction<T>): number;
/**
* Scan from right, until a test passes.
* [๐](https://github.com/nodef/extra-iterable/wiki/scanUntilRight)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns first index where test fails till end
*/
declare function scanUntilRight<T>(x: Iterable<T>, ft: TestFunction<T>): number;
/**
* Find index of first value passing a test.
* [๐](https://github.com/nodef/extra-iterable/wiki/search)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns first index of value, -1 if not found
*/
declare function search<T>(x: Iterable<T>, ft: TestFunction<T>): number;
/**
* Find index of last value passing a test.
* [๐](https://github.com/nodef/extra-iterable/wiki/searchRight)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns last index of value, -1 if not found
*/
declare function searchRight<T>(x: Iterable<T>, ft: TestFunction<T>): number;
/**
* Find indices of values passing a test.
* [๐](https://github.com/nodef/extra-iterable/wiki/searchAll)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns indices of value
*/
declare function searchAll<T>(x: Iterable<T>, ft: TestFunction<T>): IterableIterator<number>;
/**
* Find first index of a value.
* [๐](https://github.com/nodef/extra-iterable/wiki/searchValue)
* @param x an iterable
* @param v search value
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns first index of value, -1 if not found
*/
declare function searchValue<T, U = T>(x: Iterable<T>, v: T, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): number;
/**
* Find last index of a value.
* [๐](https://github.com/nodef/extra-iterable/wiki/searchValueRight)
* @param x an iterable
* @param v search value
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns last index of value, -1 if not found
*/
declare function searchValueRight<T, U = T>(x: Iterable<T>, v: T, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): number;
/**
* Find indices of a value.
* [๐](https://github.com/nodef/extra-iterable/wiki/searchValueAll)
* @param x an iterable
* @param v search value
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns indices of value
*/
declare function searchValueAll<T, U = T>(x: Iterable<T>, v: T, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): IterableIterator<number>;
/**
* Find first index of an infix.
* [๐](https://github.com/nodef/extra-iterable/wiki/searchInfix)
* @param x an iterable
* @param y search infix
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns first i | x[i..i+|y|] = y else -1
*/
declare function searchInfix<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): number;
/**
* Find last index of an infix.
* [๐](https://github.com/nodef/extra-iterable/wiki/searchInfixRight)
* @param x an iterable
* @param y search infix
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns first i | x[i..i+|y|] = y else -1
*/
declare function searchInfixRight<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): number;
/**
* Find indices of an infix.
* [๐](https://github.com/nodef/extra-iterable/wiki/searchInfixAll)
* @param x an iterable
* @param y search infix
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns iโ, iโ, ... | x[j..j+|y|] = y; j โ [iโ, iโ, ...]
*/
declare function searchInfixAll<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): IterableIterator<number>;
/**
* Find first index of a subsequence.
* [๐](https://github.com/nodef/extra-iterable/wiki/searchSubsequence)
* @param x an iterable
* @param y search subsequence
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns start index of subsequence, -1 if not found
*/
declare function searchSubsequence<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): number;
/**
* Check if iterable has a value.
* [๐](https://github.com/nodef/extra-iterable/wiki/hasValue)
* @param x an iterable
* @param v search value
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns v โ x?
*/
declare function hasValue<T, U = T>(x: Iterable<T>, v: T, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): boolean;
/**
* Check if iterable starts with a prefix.
* [๐](https://github.com/nodef/extra-iterable/wiki/hasPrefix)
* @param x an iterable
* @param y search prefix
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x[0..|y|] = y?
*/
declare function hasPrefix<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): boolean;
/**
* Check if iterable ends with a suffix.
* [๐](https://github.com/nodef/extra-iterable/wiki/hasSuffix)
* @param x an iterable
* @param y seach suffix
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x[|x|-|y|..] = y?
*/
declare function hasSuffix<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): boolean;
/**
* Check if iterable contains an infix.
* [๐](https://github.com/nodef/extra-iterable/wiki/hasInfix)
* @param x an iterable
* @param y search infix
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x[i..I] = y for some i, I?
*/
declare function hasInfix<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): boolean;
/**
* Check if iterable has a subsequence.
* [๐](https://github.com/nodef/extra-iterable/wiki/hasSubsequence)
* @param x an iterable
* @param y search subsequence
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x[iโ] โงบ x[iโ] โงบ ... = y, for some iโ, iโ, ...? | iโ < iโ < ...
*/
declare function hasSubsequence<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): boolean;
/**
* Call a function for each value.
* [๐](https://github.com/nodef/extra-iterable/wiki/forEach)
* @param x an iterable
* @param fp process function (v, i, x)
*/
declare function forEach<T>(x: Iterable<T>, fp: ProcessFunction<T>): void;
/**
* Check if any value satisfies a test.
* [๐](https://github.com/nodef/extra-iterable/wiki/some)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns true if ft(vแตข) = true for some vแตข โ x
*/
declare function some<T>(x: Iterable<T>, ft?: TestFunction<T> | null): boolean;
/**
* Check if all values satisfy a test.
* [๐](https://github.com/nodef/extra-iterable/wiki/every)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns true if ft(vแตข) = true for all vแตข โ x
*/
declare function every<T>(x: Iterable<T>, ft?: TestFunction<T> | null): boolean;
/**
* Transform values of an iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/map)
* @param x an iterable
* @param fm map function (v, i, x)
* @returns fm(vโ), fm(vโ), ... | vแตข โ x
*/
declare function map<T, U>(x: Iterable<T>, fm: MapFunction<T, U>): IterableIterator<U>;
/**
* Reduce values of iterable to a single value.
* [๐](https://github.com/nodef/extra-iterable/wiki/reduce)
* @param x an iterable
* @param fr reduce function (acc, v, i, x)
* @param acc initial value
* @returns fr(fr(acc, vโ), vโ)... | fr(acc, vโ) = vโ if acc not given
*/
declare function reduce<T, U>(x: Iterable<T>, fr: ReduceFunction<T, U>, acc?: U): U;
/**
* Keep the values which pass a test.
* [๐](https://github.com/nodef/extra-iterable/wiki/filter)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns vโ, vโ, ... | ft(vแตข) = true; vแตข โ x
*/
declare function filter<T>(x: Iterable<T>, ft: TestFunction<T>): IterableIterator<T>;
/**
* Keep the values at given indices.
* [๐](https://github.com/nodef/extra-iterable/wiki/filterAt)
* @param x an iterable
* @param is indices (sorted)
* @returns vโ, vโ, ... | vแตข = x[i]; i โ is
*/
declare function filterAt<T>(x: Iterable<T>, is: number[]): IterableIterator<T>;
/**
* Discard the values which pass a test.
* [๐](https://github.com/nodef/extra-iterable/wiki/reject)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns vโ, vโ, ... | ft(vแตข) = false; vแตข โ x
*/
declare function reject<T>(x: Iterable<T>, ft: TestFunction<T>): IterableIterator<T>;
/**
* Discard the values at given indices.
* [๐](https://github.com/nodef/extra-iterable/wiki/rejectAt)
* @param x an iterable
* @param is indices (sorted)
* @returns vโ, vโ, ... | vแตข = x[i]; i โ is
*/
declare function rejectAt<T>(x: Iterable<T>, is: number[]): IterableIterator<T>;
/**
* Produce accumulating values.
* [๐](https://github.com/nodef/extra-iterable/wiki/accumulate)
* @param x an iterable
* @param fr reduce function (acc, v, i, x)
* @param acc initial value
* @returns fr(acc, vโ), fr(fr(acc, vโ), vโ), ... | fr(acc, vโ) = vโ if acc not given
*/
declare function accumulate<T, U = T>(x: Iterable<T>, fr: ReduceFunction<T, T | U>, acc?: T | U): IterableIterator<T | U>;
/**
* Flatten nested iterable to given depth.
* [๐](https://github.com/nodef/extra-iterable/wiki/flat)
* @param x a nested iterable
* @param n maximum depth (-1 โ all)
* @param fm map function (v, i, x)
* @param ft flatten test (v, i, x) [isList]
* @returns flat iterable
*/
declare function flat(x: Iterable<any>, n?: number, fm?: MapFunction<any, any> | null, ft?: TestFunction<any> | null): IterableIterator<any>;
/**
* Flatten nested iterable, based on map function.
* [๐](https://github.com/nodef/extra-iterable/wiki/flatMap)
* @param x a nested iterable
* @param fm map function (v, i, x)
* @param ft flatten test (v, i, x) [isList]
* @returns flat iterable
*/
declare function flatMap(x: Iterable<any>, fm?: MapFunction<any, any> | null, ft?: TestFunction<any> | null): IterableIterator<any>;
/**
* Combine values from iterables.
* [๐](https://github.com/nodef/extra-iterable/wiki/zip)
* @param xs iterables
* @param fm map function (vs, i, xs)
* @param fe end function (dones) [some]
* @param vd default value
* @returns fm([xโ[0], xโ[0], ...]), fm([xโ[1], xโ[1], ...]), ...
*/
declare function zip<T, U = T[]>(xs: Iterable<T>[], fm?: MapFunction<T[], T[] | U> | null, fe?: EndFunction | null, vd?: T): IterableIterator<T[] | U>;
/**
* Fill with given value.
* [๐](https://github.com/nodef/extra-iterable/wiki/fill)
* @param x an iterable
* @param v value
* @param i start index [0]
* @param I end index [END]
* @returns x' | x' = x; x'[i..I] = v
*/
declare function fill<T>(x: Iterable<T>, v: T, i?: number, I?: number): IterableIterator<T>;
/**
* Add values to the end.
* [๐](https://github.com/nodef/extra-iterable/wiki/push)
* @param x an iterable
* @param vs values to add
* @returns ...x, ...vs
*/
declare function push<T>(x: Iterable<T>, ...vs: T[]): IterableIterator<T>;
/**
* Add values to the start.
* [๐](https://github.com/nodef/extra-iterable/wiki/unshift)
* @param x an iterable
* @param vs values to add
* @returns ...vs, ...x
*/
declare function unshift<T>(x: Iterable<T>, ...vs: T[]): IterableIterator<T>;
/**
* Copy part of iterable to another.
* [๐](https://github.com/nodef/extra-iterable/wiki/copy)
* @param x target iterable
* @param y source iterable
* @param j write index [0]
* @param i read start index [0]
* @param I read end index [END]
* @returns x[0..j] โงบ y[i..I] โงบ x[j+I-i..]
*/
declare function copy<T>(x: Iterable<T>, y: Iterable<T>, j?: number, i?: number, I?: number): IterableIterator<T>;
/**
* Copy part of iterable within.
* [๐](https://github.com/nodef/extra-iterable/wiki/copyWithin)
* @param x an iterable
* @param j write index [0]
* @param i read start index [0]
* @param I read end index [END]
* @returns x[0..j] โงบ x[i..I] โงบ x[j+I-i..]
*/
declare function copyWithin<T>(x: Iterable<T>, j?: number, i?: number, I?: number): IterableIterator<T>;
/**
* Move part of iterable within.
* [๐](https://github.com/nodef/extra-iterable/wiki/moveWithin)
* @param x an iterable
* @param j write index [0]
* @param i read start index [0]
* @param I read end index [END]
* @returns x[0..j] โงบ x[i..I] โงบ x[j..i] โงบ x[I..]
*/
declare function moveWithin<T>(x: Iterable<T>, j?: number, i?: number, I?: number): IterableIterator<T>;
/**
* Remove or replaces existing values.
* [๐](https://github.com/nodef/extra-iterable/wiki/splice)
* @param x an iterable
* @param i remove index [0]
* @param n number of values to remove [rest]
* @param vs values to insert
* @returns x[0..i] โงบ vs โงบ x[i+n..]
*/
declare function splice<T>(x: Iterable<T>, i?: number, n?: number, ...vs: T[]): IterableIterator<T>;
/**
* Break iterable considering test as separator.
* [๐](https://github.com/nodef/extra-iterable/wiki/split)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns x[j..k] โงบ x[l..m] โงบ ... | ft(x[i]) = true; i = 0..j / k..l / ...
*/
declare function split<T>(x: Iterable<T>, ft: TestFunction<T>): IterableIterator<T[]>;
/**
* Break iterable considering indices as separator.
* [๐](https://github.com/nodef/extra-iterable/wiki/splitAt)
* @param x an iterable
* @param is indices (sorted)
* @returns x[j..k] โงบ x[l..m] โงบ ... | ft(x[i]) = true; i = 0..j / k..l / ...; i โ is
*/
declare function splitAt<T>(x: Iterable<T>, is: number[]): IterableIterator<T[]>;
/**
* Break iterable when test passes.
* [๐](https://github.com/nodef/extra-iterable/wiki/cut)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns x[0..j] โงบ x[j..k] โงบ ... | ft(x[i]) = true; i = j, k, ...
*/
declare function cut<T>(x: Iterable<T>, ft: TestFunction<T>): IterableIterator<T[]>;
/**
* Break iterable after test passes.
* [๐](https://github.com/nodef/extra-iterable/wiki/cutRight)
* @param x an iterable
* @param ft test function (v, i, x)
* @returns x[0..j+1] โงบ x[j+1..k] โงบ ... | ft(x[i]) = true; i = j, k, ...
*/
declare function cutRight<T>(x: Iterable<T>, ft: TestFunction<T>): IterableIterator<T[]>;
/**
* Break iterable at given indices.
* [๐](https://github.com/nodef/extra-iterable/wiki/cutAt)
* @param x an iterable
* @param is split indices (sorted)
* @returns x[0..j] โงบ x[j..k] โงบ ... | ft(x[i]) = true; i = j, k, ...; i โ is
*/
declare function cutAt<T>(x: Iterable<T>, is: Iterable<number>): IterableIterator<T[]>;
/**
* Break iterable after given indices.
* [๐](https://github.com/nodef/extra-iterable/wiki/cutAtRight)
* @param x an iterable
* @param is split indices (sorted)
* @returns x[0..j+1] โงบ x[j+1..k] โงบ ... | ft(x[i]) = true; i = j, k, ...; i โ is
*/
declare function cutAtRight<T>(x: Iterable<T>, is: Iterable<number>): IterableIterator<T[]>;
/**
* Keep similar values together and in order.
* [๐](https://github.com/nodef/extra-iterable/wiki/group)
* @param x an iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x[0..k], x[k..l], ... | fc(x[i], x[j]) = 0; i, j = 0..k / k..l / ...
*/
declare function group<T, U = T>(x: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): IterableIterator<T[]>;
/**
* Segregate values by test result.
* [๐](https://github.com/nodef/extra-iterable/wiki/partition)
* @param x an array
* @param ft test function (v, i, x)
* @returns [satisfies, doesnt]
*/
declare function partition<T>(x: Iterable<T>, ft: TestFunction<T>): [T[], T[]];
/**
* Segregate values by similarity.
* [๐](https://github.com/nodef/extra-iterable/wiki/partitionAs)
* @param x an array
* @param fm map function (v, i, x)
* @returns Map \{key โ values\}
*/
declare function partitionAs<T, U = T>(x: Iterable<T>, fm?: MapFunction<T, T | U> | null): Map<T | U, T[]>;
/**
* Break iterable into chunks of given size.
* [๐](https://github.com/nodef/extra-iterable/wiki/chunk)
* @param x an iterable
* @param n chunk size [1]
* @param s chunk step [n]
* @returns x[0..n], x[s..s+n], x[2s..2s+n], ...
*/
declare function chunk<T>(x: Iterable<T>, n?: number, s?: number): IterableIterator<T[]>;
/**
* Obtain values that cycle through an iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/cycle)
* @param x an iterable
* @param i start index [0]
* @param n number of values [-1 โ Inf]
* @returns x[i..] โงบ x โงบ x โงบ ... with upto n values
*/
declare function cycle<T>(x: Iterable<T>, i?: number, n?: number): IterableIterator<T>;
/**
* Repeat an iterable given times.
* [๐](https://github.com/nodef/extra-iterable/wiki/repeat)
* @param x an iterable
* @param n times [-1 โ Inf]
* @returns ...x, ...x, ...(n times)
*/
declare function repeat<T>(x: Iterable<T>, n?: number): IterableIterator<T>;
/**
* Reverse the values.
* [๐](https://github.com/nodef/extra-iterable/wiki/reverse)
* @param x an iterable
* @returns x[|x|-1], x[|x|-2], ..., x[1], x[0]
*/
declare function reverse<T>(x: Iterable<T>): IterableIterator<T>;
/**
* Rotate values in iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/rotate)
* @param x an iterable
* @param n rotate amount (+ve: left, -ve: right) [0]
* @returns x[n..] โงบ x[0..n]
*/
declare function rotate<T>(x: Iterable<T>, n?: number): IterableIterator<T>;
/**
* Place a separator between every value.
* [๐](https://github.com/nodef/extra-iterable/wiki/intersperse)
* @param x an iterable
* @param v separator
* @returns x[0], v, x[1], v, ..., x[|x|-1]
*/
declare function intersperse<T>(x: Iterable<T>, v: T): IterableIterator<T>;
/**
* Estimate new values between existing ones.
* [๐](https://github.com/nodef/extra-iterable/wiki/interpolate)
* @param x an iterable
* @param fc combine function (a, b)
* @returns x[0], fc(x[0], x[1]), x[1], fc(x[1], x[2]), ..., x[|x|-1]
*/
declare function interpolate<T>(x: Iterable<T>, fc: CombineFunction<T>): IterableIterator<T>;
/**
* Place values of an iterable between another.
* [๐](https://github.com/nodef/extra-iterable/wiki/intermix)
* @param x an iterable
* @param y another iterable
* @param m number of values from x [1]
* @param n number of values from y [1]
* @param s step size for x [m]
* @param t step size for y [n]
* @returns x[0..m], y[0..n], x[s..s+m], y[t..t+n], ..., x[k*s..|x|-1] | k โ W
*/
declare function intermix<T>(x: Iterable<T>, y: Iterable<T>, m?: number, n?: number, s?: number, t?: number): IterableIterator<T>;
/**
* Place values from iterables alternately.
* [๐](https://github.com/nodef/extra-iterable/wiki/interleave)
* @param xs iterables
* @returns xโ[0], xโ[0], ..., xโ[1], xโ[0], ... | [xโ, xโ, ...] = xs
*/
declare function interleave<T>(xs: Iterable<T>[]): IterableIterator<T>;
/**
* Append values from iterables.
* [๐](https://github.com/nodef/extra-iterable/wiki/concat)
* @param xs iterables
* @returns ...xโ, ...xโ, ... | [xโ, xโ, ...] = xs
*/
declare function concat<T>(...xs: Iterable<T>[]): IterableIterator<T>;
/**
* Merge values from sorted iterables.
* [๐](https://github.com/nodef/extra-iterable/wiki/merge)
* @param xs iterables
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns sort(concat(...xs))
*/
declare function merge<T, U = T>(xs: Iterable<T>[], fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): IterableIterator<T>;
/**
* Join values together into a string.
* [๐](https://github.com/nodef/extra-iterable/wiki/join)
* @param x an iterable
* @param sep separator [,]
* @returns "$\{vโ\}$\{sep\}$\{vโ\}..." | vแตข โ x
*/
declare function join<T>(x: Iterable<T>, sep?: string): string;
/**
* Check if there are no duplicate values.
* [๐](https://github.com/nodef/extra-iterable/wiki/isUnique)
* @param x an array
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns โ vแตข, vโฑผ โ x, is vแตข โ vโฑผ?
*/
declare function isUnique<T, U = T>(x: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): boolean;
/**
* Checks if arrays have no value in common.
* [๐](https://github.com/nodef/extra-iterable/wiki/isDisjoint)
* @param x an array
* @param y another array
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x โฉ y = ฮฆ?
*/
declare function isDisjoint<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): boolean;
/**
* Remove duplicate values.
* [๐](https://github.com/nodef/extra-iterable/wiki/unique)
* @param x an iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns vโ, vโ, ... | vแตข โ x; vแตข โ vโฑผ โ i, j
*/
declare function unique<T, U = T>(x: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): IterableIterator<T>;
/**
* Obtain values present in any iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/union)
* @param x an iterable
* @param y another iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x โช y = \{v | v โ x or v โ y\}
*/
declare function union<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): IterableIterator<T>;
/**
* Obtain values present in both iterables.
* [๐](https://github.com/nodef/extra-iterable/wiki/intersection)
* @param x an iterable
* @param y another iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x โฉ y = \{v | v โ x, v โ y\}
*/
declare function intersection<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): IterableIterator<T>;
/**
* Obtain values not present in another iterable.
* [๐](https://github.com/nodef/extra-iterable/wiki/difference)
* @param x an iterable
* @param y another iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x - y = \{v | v โ x, v โ y\}
*/
declare function difference<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): IterableIterator<T>;
/**
* Obtain values not present in both iterables.
* [๐](https://github.com/nodef/extra-iterable/wiki/symmetricDifference)
* @param x an iterable
* @param y another iterable
* @param fc compare function (a, b)
* @param fm map function (v, i, x)
* @returns x-y โช y-x
*/
declare function symmetricDifference<T, U = T>(x: Iterable<T>, y: Iterable<T>, fc?: CompareFunction<T | U> | null, fm?: MapFunction<T, T | U> | null): IterableIterator<T>;
/**
* List cartesian product of iterables.
* [๐](https://github.com/nodef/extra-iterable/wiki/cartesianProduct)
* @param xs iterables
* @param fm map function (vs, i)
* @returns xโ ร xโ ร ... = \{[vโ, vโ, ...] | vโ โ xโ, vโ โ xโ, ...] \}
*/
declare function cartesianProduct<T, U = T>(xs: Iterable<T>[], fm?: MapFunction<T[], T[] | U> | null): IterableIterator<T[] | U>;
export { type CombineFunction, type CompareFunction, END, type EndFunction, type MapFunction, type ProcessFunction, type ReadFunction, type ReduceFunction, type TestFunction, accumulate, toInvokable as callable, cartesianProduct, chunk, compare, concat, copy, copyWithin, count, countAs, cut, cutAt, cutAtRight, cutRight, cycle, difference, drop, dropRight, dropWhile, dropWhileRight, entries, every, fill, filter, filterAt, find, filter as findAll, findRight, flat, flatMap, forEach, from, fromApplication, fromApplication as fromApply, fromInvocation as fromCall, fromInvocation, fromIterator, fromRange, get, getAll, getPath, group, hasInfix, hasPath, hasPrefix, hasSubsequence, hasSuffix, hasValue, head, includes, index, indexOf, indexRange, init, interleave, intermix, interpolate, intersection, intersperse, is, isDisjoint, isEmpty, isEqual, isIterator, isList, isMany, isOnce, isUnique, iterator, join, keys, last, lastIndexOf, left, length, toMany as many, map, max, maxEntry, merge, middle, min, minEntry, moveWithin, partition, partitionAs, init as pop, push, range, rangeEntries, reduce, reject, rejectAt, remove, repeat, reverse, right, rotate, scanUntil, scanUntilRight, scanWhile, scanWhileRight, search, searchAll, searchInfix, searchInfixAll, searchInfixRight, searchRight, searchSubsequence, searchValue, searchValueAll, searchValueRight, set, tail as shift, length as size, slice, some, splice, split, splitAt, swap, symmetricDifference, tail, take, takeRight, takeWhile, takeWhileRight, toInvokable as toCallable, toInvokable, toMany, values as toOnce, union, unique, unshift, values, zip };