import type { Either } from "../../../Either/index.js";
import * as O from "../../../Option/index.js";
import type { Ord } from "../../../Ord/index.js";
import * as St from "../../../Structural/index.js";
import * as Tp from "../Tuple/index.js";
export declare type Sizes = number[] | undefined;
export declare class Node {
sizes: Sizes;
array: any[];
constructor(sizes: Sizes, array: any[]);
}
/**
* Represents a list of elements.
*/
export declare class List implements Iterable, St.HasEquals, St.HasHash {
readonly bits: number;
readonly offset: number;
readonly length: number;
readonly prefix: A[];
readonly root: Node | undefined;
readonly suffix: A[];
constructor(bits: number, offset: number, length: number, prefix: A[], root: Node | undefined, suffix: A[]);
[Symbol.iterator](): Iterator;
toJSON(): readonly A[];
[St.equalsSym](that: unknown): boolean;
get [St.hashSym](): number;
}
export declare type MutableList = {
-readonly [K in keyof List]: List[K];
} & {
[Symbol.iterator]: () => Iterator;
"@@mutable": true;
};
/**
* Returns an iterable that iterates backwards over the given list.
*
* @complexity O(1)
*/
export declare function backwards(l: List): Iterable;
export declare function emptyPushable(): MutableList;
/** Appends the value to the list by _mutating_ the list and its content. */
export declare function push_(l: MutableList, value: A): MutableList;
/**
* Creates a list of the given elements.
*
* @complexity O(n)
*/
export declare function list(...elements: A[]): List;
/**
* Creates an empty list.
*
* @complexity O(1)
*/
export declare function empty(): List;
/**
* Takes a single arguments and returns a singleton list that contains it.
*
* @complexity O(1)
*/
export declare function of(a: A): List;
/**
* Takes two arguments and returns a list that contains them.
*
* @complexity O(1)
*/
export declare function pair(second: A): (first: A) => List;
/**
* Takes two arguments and returns a list that contains them.
*
* @complexity O(1)
*/
export declare function pair_(first: A, second: A): List;
/**
* Converts an array, an array-like, or an iterable into a list.
*
* @complexity O(n)
*/
export declare function from(sequence: A[] | ArrayLike | Iterable): List;
/**
* Returns a list of numbers between an inclusive lower bound and an exclusive upper bound.
*
* @complexity O(n)
*/
export declare function range(end: number): (start: number) => List;
/**
* Returns a list of numbers between an inclusive lower bound and an exclusive upper bound.
*
* @complexity O(n)
*/
export declare function range_(start: number, end: number): List;
/**
* Returns a list of a given length that contains the specified value
* in all positions.
*
* @complexity O(n)
*/
export declare function repeat(times: number): (value: A) => List;
/**
* Returns a list of a given length that contains the specified value
* in all positions.
*
* @complexity O(n)
*/
export declare function repeat_(value: A, times: number): List;
/**
* Generates a new list by calling a function with the current index
* `n` times.
*
* @complexity O(n)
*/
export declare function times(times: number): (func: (index: number) => A) => List;
/**
* Generates a new list by calling a function with the current index
* `n` times.
*
* @complexity O(n)
*/
export declare function times_(func: (index: number) => A, times: number): List;
/**
* Gets the nth element of the list. If `n` is out of bounds
* `undefined` is returned.
*
* @complexity O(log(n))
*/
export declare function unsafeNth_(l: List, index: number): A | undefined;
/**
* Gets the nth element of the list. If `n` is out of bounds
* `undefined` is returned.
*
* @complexity O(log(n))
*/
export declare function unsafeNth(index: number): (l: List) => A | undefined;
/**
* Gets the nth element of the list. If `n` is out of bounds
* `undefined` is returned.
*
* @complexity O(log(n))
*/
export declare function nth_(l: List, index: number): O.Option;
/**
* Gets the nth element of the list. If `n` is out of bounds
* `undefined` is returned.
*
* @complexity O(log(n))
*/
export declare function nth(index: number): (l: List) => O.Option;
/**
* Prepends an element to the front of a list and returns the new list.
*
* @complexity O(1)
*/
export declare function prepend_(l: List, value: A): List;
/**
* Prepends an element to the front of a list and returns the new list.
*
* @complexity O(1)
*/
export declare function prepend(value: A): (l: List) => List;
/**
* Appends an element to the end of a list and returns the new list.
*
* @complexity O(n)
*/
export declare function append_(l: List, value: A): List;
/**
* Appends an element to the end of a list and returns the new list.
*
* @complexity O(n)
*/
export declare function append(value: A): (l: List) => List;
/**
* Gets the length of a list.
*
* @complexity `O(1)`
*/
export declare function size(l: List): number;
/**
* Returns the first element of the list. If the list is empty the
* function returns undefined.
*
* @complexity O(1)
*/
export declare function unsafeFirst(l: List): A | undefined;
/**
* Returns the first element of the list. If the list is empty the
* function returns undefined.
*
* @complexity O(1)
*/
export declare function first(l: List): O.Option;
/**
* Returns the last element of the list. If the list is empty the
* function returns `undefined`.
*
* @complexity O(1)
*/
export declare function unsafeLast(l: List): A | undefined;
/**
* Returns the last element of the list. If the list is empty the
* function returns `undefined`.
*
* @complexity O(1)
*/
export declare function last(l: List): O.Option;
/**
* Applies a function to each element in the given list and returns a
* new list of the values that the function return.
*
* @complexity O(n)
*/
export declare function map_(l: List, f: (a: A) => B): List;
/**
* Applies a function to each element in the given list and returns a
* new list of the values that the function return.
*
* @complexity O(n)
*/
export declare function map(f: (a: A) => B): (l: List) => List;
/**
* Extracts the specified property from each object in the list.
*/
export declare function pluck_(l: List, key: K): List;
/**
* Extracts the specified property from each object in the list.
*/
export declare function pluck(key: K): (l: List) => List;
/**
* Folds a function over a list. Left-associative.
*/
export declare function reduce_(l: List, initial: B, f: (acc: B, value: A) => B): B;
/**
* Folds a function over a list. Left-associative.
*/
export declare function reduce(initial: B, f: (acc: B, value: A) => B): (l: List) => B;
/**
* Folds a function over a list from left to right while collecting
* all the intermediate steps in a resulting list.
*/
export declare function scan_(l: List, initial: B, f: (acc: B, value: A) => B): List;
/**
* Folds a function over a list from left to right while collecting
* all the intermediate steps in a resulting list.
*/
export declare function scan(initial: B, f: (acc: B, value: A) => B): (l: List) => List;
/**
* Invokes a given callback for each element in the list from left to
* right. Returns `undefined`.
*
* This function is very similar to map. It should be used instead of
* `map` when the mapping function has side-effects. Whereas `map`
* constructs a new list `forEach` merely returns `undefined`. This
* makes `forEach` faster when the new list is unneeded.
*
* @complexity O(n)
*/
export declare function forEach_(l: List, callback: (a: A) => void): void;
/**
* Invokes a given callback for each element in the list from left to
* right. Returns `undefined`.
*
* This function is very similar to map. It should be used instead of
* `map` when the mapping function has side-effects. Whereas `map`
* constructs a new list `forEach` merely returns `undefined`. This
* makes `forEach` faster when the new list is unneeded.
*
* @complexity O(n)
*/
export declare function forEach(callback: (a: A) => void): (l: List) => void;
/**
* Returns a new list that only contains the elements of the original
* list for which the predicate returns `true`.
*
* @complexity O(n)
*/
export declare function filter_(l: List, predicate: (a: A) => a is B): List;
export declare function filter_(l: List, predicate: (a: A) => boolean): List;
/**
* Returns a new list that only contains the elements of the original
* list for which the predicate returns `true`.
*
* @complexity O(n)
*/
export declare function filter(predicate: (a: A) => a is B): (l: List) => List;
export declare function filter(predicate: (a: A) => boolean): (l: List) => List;
/**
* Returns a new list that only contains the elements of the original
* list for which the f returns `Some`.
*
* @complexity O(n)
*/
export declare function filterMap_(l: List, f: (a: A) => O.Option): List;
/**
* Returns a new list that only contains the elements of the original
* list for which the f returns `Some`.
*
* @complexity O(n)
*/
export declare function filterMap(f: (a: A) => O.Option): (l: List) => List;
/**
* Filter out optional values
*/
export declare function compact(fa: List>): List;
/**
* Returns a new list that only contains the elements of the original
* list for which the predicate returns `false`.
*
* @complexity O(n)
*/
export declare function filterNot_(l: List, predicate: (a: A) => boolean): List;
/**
* Returns a new list that only contains the elements of the original
* list for which the predicate returns `false`.
*
* @complexity O(n)
*/
export declare function filterNot(predicate: (a: A) => boolean): (l: List) => List;
/**
* Splits the list into two lists. One list that contains all the
* values for which the predicate returns `true` and one containing
* the values for which it returns `false`.
*
* @complexity O(n)
*/
export declare function partition_(l: List, predicate: (a: A) => a is B): Tp.Tuple<[List, List>]>;
export declare function partition_(l: List, predicate: (a: A) => boolean): Tp.Tuple<[List, List]>;
/**
* Splits the list into two lists. One list that contains all the
* values for which the predicate returns `true` and one containing
* the values for which it returns `false`.
*
* @complexity O(n)
*/
export declare function partition(predicate: (a: A) => a is B): (l: List) => Tp.Tuple<[List, List>]>;
export declare function partition(predicate: (a: A) => boolean): (l: List) => Tp.Tuple<[List, List]>;
/**
* Splits the list into two lists. One list that contains the lefts
* and one contains the rights
*
* @complexity O(n)
*/
export declare function partitionMap_(l: List, f: (_: A) => Either): Tp.Tuple<[List, List]>;
/**
* Splits the list into two lists. One list that contains the lefts
* and one contains the rights
*
* @complexity O(n)
*/
export declare function partitionMap(f: (_: A) => Either): (l: List) => Tp.Tuple<[List, List]>;
/**
* Splits the list into two lists. One list that contains the lefts
* and one contains the rights
*
* @complexity O(n)
*/
export declare function separate(l: List>): Tp.Tuple<[List, List]>;
/**
* Concats the strings in the list separated by a specified separator.
*/
export declare function join_(l: List, separator: string): string;
/**
* Concats the strings in the list separated by a specified separator.
*/
export declare function join(separator: string): (l: List) => string;
/**
* Folds a function over a list. Right-associative.
*
* @complexity O(n)
*/
export declare function reduceRight_(l: List, initial: B, f: (value: A, acc: B) => B): B;
/**
* Folds a function over a list. Right-associative.
*
* @complexity O(n)
*/
export declare function reduceRight(initial: B, f: (value: A, acc: B) => B): (l: List) => B;
/**
* Applies a list of functions to a list of values.
*/
export declare function ap_(listF: List<(a: A) => B>, l: List): List;
/**
* Applies a list of functions to a list of values.
*/
export declare function ap(l: List): (listF: List<(a: A) => B>) => List;
/**
* Flattens a list of lists into a list. Note that this function does
* not flatten recursively. It removes one level of nesting only.
*
* @complexity O(n * log(m)), where n is the length of the outer list and m the length of the inner lists.
*/
export declare function flatten(nested: List>): List;
/**
* Maps a function over a list and concatenates all the resulting
* lists together.
*/
export declare function chain_(l: List, f: (a: A) => List): List;
/**
* Maps a function over a list and concatenates all the resulting
* lists together.
*/
export declare function chain(f: (a: A) => List): (l: List) => List;
export declare function reduceWhile_(l: List, initial: B, predicate: (acc: B, value: A) => boolean, f: (acc: B, value: A) => B): B;
export declare function reduceWhile(initial: B, predicate: (acc: B, value: A) => boolean, f: (acc: B, value: A) => B): (l: List) => B;
/**
* Returns `true` if and only if the predicate function returns `true`
* for all elements in the given list.
*
* @complexity O(n)
*/
export declare function every_(l: List, predicate: (a: A) => boolean): boolean;
/**
* Returns `true` if and only if the predicate function returns `true`
* for all elements in the given list.
*
* @complexity O(n)
*/
export declare function every(predicate: (a: A) => boolean): (l: List) => boolean;
/**
* Returns true if and only if there exists an element in the list for
* which the predicate returns true.
*
* @complexity O(n)
*/
export declare function some_(l: List, predicate: (a: A) => boolean): boolean;
/**
* Returns true if and only if there exists an element in the list for
* which the predicate returns true.
*
* @complexity O(n)
*/
export declare function some(predicate: (a: A) => boolean): (l: List) => boolean;
/**
* Returns `true` if and only if the predicate function returns
* `false` for every element in the given list.
*
* @complexity O(n)
*/
export declare function none_(l: List, predicate: (a: A) => boolean): boolean;
/**
* Returns `true` if and only if the predicate function returns
* `false` for every element in the given list.
*
* @complexity O(n)
*/
export declare function none(predicate: (a: A) => boolean): (l: List) => boolean;
/**
* Returns the _first_ element for which the predicate returns `true`.
* If no such element is found the function returns `undefined`.
*
* @complexity O(n)
*/
export declare function unsafeFind_(l: List, predicate: (a: A) => boolean): A | undefined;
/**
* Returns the _first_ element for which the predicate returns `true`.
* If no such element is found the function returns `undefined`.
*
* @complexity O(n)
*/
export declare function unsafeFind(predicate: (a: A) => boolean): (l: List) => A | undefined;
/**
* Returns the _first_ element for which the predicate returns `true`.
* If no such element is found the function returns `undefined`.
*
* @complexity O(n)
*/
export declare function find_(l: List, predicate: (a: A) => boolean): O.Option;
/**
* Returns the _first_ element for which the predicate returns `true`.
* If no such element is found the function returns `undefined`.
*
* @complexity O(n)
*/
export declare function find(predicate: (a: A) => boolean): (l: List) => O.Option;
/**
* Returns the _last_ element for which the predicate returns `true`.
* If no such element is found the function returns `undefined`.
*
* @complexity O(n)
*/
export declare function unsafeFindLast_(l: List, predicate: (a: A) => boolean): A | undefined;
/**
* Returns the _last_ element for which the predicate returns `true`.
* If no such element is found the function returns `undefined`.
*
* @complexity O(n)
*/
export declare function unsafeFindLast(predicate: (a: A) => boolean): (l: List) => A | undefined;
/**
* Returns the _last_ element for which the predicate returns `true`.
* If no such element is found the function returns `undefined`.
*
* @complexity O(n)
*/
export declare function findLast_(l: List, predicate: (a: A) => boolean): O.Option;
/**
* Returns the _last_ element for which the predicate returns `true`.
* If no such element is found the function returns `undefined`.
*
* @complexity O(n)
*/
export declare function findLast(predicate: (a: A) => boolean): (l: List) => O.Option;
/**
* Returns the index of the _first_ element in the list that is equal
* to the given element. If no such element is found `-1` is returned.
*
* @complexity O(n)
*/
export declare function indexOf_(l: List, element: A): number;
/**
* Returns the index of the _first_ element in the list that is equal
* to the given element. If no such element is found `-1` is returned.
*
* @complexity O(n)
*/
export declare function indexOf(element: A): (l: List) => number;
/**
* Returns the index of the _last_ element in the list that is equal
* to the given element. If no such element is found `-1` is returned.
*
* @complexity O(n)
*/
export declare function lastIndexOf_(l: List, element: A): number;
/**
* Returns the index of the _last_ element in the list that is equal
* to the given element. If no such element is found `-1` is returned.
*
* @complexity O(n)
*/
export declare function lastIndexOf(element: A): (l: List) => number;
/**
* Returns the index of the `first` element for which the predicate
* returns true. If no such element is found the function returns
* `-1`.
*
* @complexity O(n)
*/
export declare function findIndex_(l: List, predicate: (a: A) => boolean): number;
/**
* Returns the index of the `first` element for which the predicate
* returns true. If no such element is found the function returns
* `-1`.
*
* @complexity O(n)
*/
export declare function findIndex(predicate: (a: A) => boolean): (l: List) => number;
/**
* Returns `true` if the list contains the specified element.
* Otherwise it returns `false`.
*
* @complexity O(n)
*/
export declare function contains_(l: List, element: A): boolean;
/**
* Returns `true` if the list contains the specified element.
* Otherwise it returns `false`.
*
* @complexity O(n)
*/
export declare function contains(element: A): (l: List) => boolean;
/**
* Returns true if the two lists are equivalent.
*
* @complexity O(n)
*/
export declare function equals_(l1: List, l2: List): boolean;
/**
* Returns true if the two lists are equivalent.
*
* @complexity O(n)
*/
export declare function equals(l2: List): (l1: List) => boolean;
/**
* Returns true if the two lists are equivalent when comparing each
* pair of elements with the given comparison function.
*
* @complexity O(n)
*/
export declare function equalsWith_(l1: List, l2: List, f: (a: A, b: A) => boolean): boolean;
/**
* Returns true if the two lists are equivalent when comparing each
* pair of elements with the given comparison function.
*
* @complexity O(n)
*/
export declare function equalsWith(l2: List, f: (a: A, b: A) => boolean): (l1: List) => boolean;
/**
* Concatenates two lists.
*
* @complexity O(log(n))
*/
export declare function concat_(left: List, right: List): List;
/**
* Concatenates two lists.
*
* @complexity O(log(n))
*/
export declare function concat(right: List): (left: List) => List;
/**
* Returns a list that has the entry specified by the index replaced with the given value.
*
* If the index is out of bounds the given list is returned unchanged.
*
* @complexity O(log(n))
*/
export declare function update_(l: List, index: number, a: A): List;
/**
* Returns a list that has the entry specified by the index replaced with the given value.
*
* If the index is out of bounds the given list is returned unchanged.
*
* @complexity O(log(n))
*/
export declare function update(index: number, a: A): (l: List) => List;
/**
* Returns a list that has the entry specified by the index replaced with
* the value returned by applying the function to the value.
*
* If the index is out of bounds the given list is
* returned unchanged.
*
* @complexity `O(log(n))`
*/
export declare function adjust_(l: List, index: number, f: (a: A) => A): List;
/**
* Returns a list that has the entry specified by the index replaced with
* the value returned by applying the function to the value.
*
* If the index is out of bounds the given list is
* returned unchanged.
*
* @complexity `O(log(n))`
*/
export declare function adjust(index: number, f: (a: A) => A): (l: List) => List;
/**
* Returns a slice of a list. Elements are removed from the beginning and
* end. Both the indices can be negative in which case they will count
* from the right end of the list.
*
* @complexity `O(log(n))`
*/
export declare function slice_(l: List, from: number, to: number): List;
/**
* Returns a slice of a list. Elements are removed from the beginning and
* end. Both the indices can be negative in which case they will count
* from the right end of the list.
*
* @complexity `O(log(n))`
*/
export declare function slice(from: number, to: number): (l: List) => List;
/**
* Takes the first `n` elements from a list and returns them in a new list.
*
* @complexity `O(log(n))`
*/
export declare function take_(l: List, n: number): List;
/**
* Takes the first `n` elements from a list and returns them in a new list.
*
* @complexity `O(log(n))`
*/
export declare function take(n: number): (l: List) => List;
/**
* Takes the first elements in the list for which the predicate returns
* `true`.
*
* @complexity `O(k + log(n))` where `k` is the number of elements satisfying
* the predicate.
*/
export declare function takeWhile_(l: List, predicate: (a: A) => boolean): List;
/**
* Takes the first elements in the list for which the predicate returns
* `true`.
*
* @complexity `O(k + log(n))` where `k` is the number of elements satisfying
* the predicate.
*/
export declare function takeWhile(predicate: (a: A) => boolean): (l: List) => List;
/**
* Takes the last elements in the list for which the predicate returns
* `true`.
*
* @complexity `O(k + log(n))` where `k` is the number of elements
* satisfying the predicate.
*/
export declare function takeLastWhile_(l: List, predicate: (a: A) => boolean): List;
/**
* Takes the last elements in the list for which the predicate returns
* `true`.
*
* @complexity `O(k + log(n))` where `k` is the number of elements
* satisfying the predicate.
*/
export declare function takeLastWhile(predicate: (a: A) => boolean): (l: List) => List;
/**
* Removes the first elements in the list for which the predicate returns
* `true`.
*
* @complexity `O(k + log(n))` where `k` is the number of elements
* satisfying the predicate.
*/
export declare function dropWhile_(l: List, predicate: (a: A) => boolean): List;
/**
* Removes the first elements in the list for which the predicate returns
* `true`.
*
* @complexity `O(k + log(n))` where `k` is the number of elements
* satisfying the predicate.
*/
export declare function dropWhile(predicate: (a: A) => boolean): (l: List) => List;
/**
* Returns a new list without repeated elements.
*
* @complexity `O(n)`
*/
export declare function dropRepeats(l: List): List;
/**
* Returns a new list without repeated elements by using the given
* function to determine when elements are equal.
*
* @complexity `O(n)`
*/
export declare function dropRepeatsWith_(l: List, predicate: (a: A, b: A) => boolean): List;
/**
* Returns a new list without repeated elements by using the given
* function to determine when elements are equal.
*
* @complexity `O(n)`
*/
export declare function dropRepeatsWith(predicate: (a: A, b: A) => boolean): (l: List) => List;
/**
* Takes the last `n` elements from a list and returns them in a new
* list.
*
* @complexity `O(log(n))`
*/
export declare function takeLast_(l: List, n: number): List;
/**
* Takes the last `n` elements from a list and returns them in a new
* list.
*
* @complexity `O(log(n))`
*/
export declare function takeLast(n: number): (l: List) => List;
/**
* Splits a list at the given index and return the two sides in a pair.
* The left side will contain all elements before but not including the
* element at the given index. The right side contains the element at the
* index and all elements after it.
*
* @complexity `O(log(n))`
*/
export declare function splitAt_(l: List, index: number): [List, List];
/**
* Splits a list at the given index and return the two sides in a pair.
* The left side will contain all elements before but not including the
* element at the given index. The right side contains the element at the
* index and all elements after it.
*
* @complexity `O(log(n))`
*/
export declare function splitAt(index: number): (l: List) => [List, List];
/**
* Splits a list at the first element in the list for which the given
* predicate returns `true`.
*
* @complexity `O(n)`
*/
export declare function splitWhen_(l: List, predicate: (a: A) => boolean): [List, List];
/**
* Splits a list at the first element in the list for which the given
* predicate returns `true`.
*
* @complexity `O(n)`
*/
export declare function splitWhen(predicate: (a: A) => boolean): (l: List) => [List, List];
/**
* Splits the list into chunks of the given size.
*/
export declare function splitEvery_(l: List, size: number): List>;
/**
* Splits the list into chunks of the given size.
*/
export declare function splitEvery(size: number): (l: List) => List>;
/**
* Takes an index, a number of elements to remove and a list. Returns a
* new list with the given amount of elements removed from the specified
* index.
*
* @complexity `O(log(n))`
*/
export declare function remove_(l: List, from: number, amount: number): List;
/**
* Takes an index, a number of elements to remove and a list. Returns a
* new list with the given amount of elements removed from the specified
* index.
*
* @complexity `O(log(n))`
*/
export declare function remove(from: number, amount: number): (l: List) => List;
/**
* Returns a new list without the first `n` elements.
*
* @complexity `O(log(n))`
*/
export declare function drop_(l: List, n: number): List;
/**
* Returns a new list without the first `n` elements.
*
* @complexity `O(log(n))`
*/
export declare function drop(n: number): (l: List) => List;
/**
* Returns a new list without the last `n` elements.
*
* @complexity `O(log(n))`
*/
export declare function dropLast_(l: List, n: number): List;
/**
* Returns a new list without the last `n` elements.
*
* @complexity `O(log(n))`
*/
export declare function dropLast(n: number): (l: List) => List;
/**
* Returns a new list with the last element removed. If the list is
* empty the empty list is returned.
*
* @complexity `O(1)`
*/
export declare function pop(l: List): List;
/**
* Returns a new list with the first element removed. If the list is
* empty the empty list is returned.
*
* @complexity `O(1)`
*/
export declare function tail(l: List): List;
/**
* Converts a list into an array.
*
* @complexity `O(n)`
*/
export declare function toArray(l: List): readonly A[];
/**
* Inserts the given element at the given index in the list.
*
* @complexity O(log(n))
*/
export declare function insert_(l: List, index: number, element: A): List;
/**
* Inserts the given element at the given index in the list.
*
* @complexity O(log(n))
*/
export declare function insert(index: number, element: A): (l: List) => List;
/**
* Inserts the given list of elements at the given index in the list.
*
* @complexity `O(log(n))`
*/
export declare function insertAll_(l: List, index: number, elements: List): List;
/**
* Inserts the given list of elements at the given index in the list.
*
* @complexity `O(log(n))`
*/
export declare function insertAll(index: number, elements: List): (l: List) => List;
/**
* Reverses a list.
* @complexity O(n)
*/
export declare function reverse(l: List): List;
/**
* Returns `true` if the given argument is a list and `false`
* otherwise.
*
* @complexity O(1)
*/
export declare function isList(l: any): l is List;
/**
* Iterate over two lists in parallel and collect the pairs.
*
* @complexity `O(log(n))`, where `n` is the length of the smallest
* list.
*/
export declare function zip_(as: List, bs: List): List>;
/**
* Iterate over two lists in parallel and collect the pairs.
*
* @complexity `O(log(n))`, where `n` is the length of the smallest
* list.
*/
export declare function zip(bs: List): (as: List) => List>;
/**
* This is like mapping over two lists at the same time. The two lists
* are iterated over in parallel and each pair of elements is passed
* to the function. The returned values are assembled into a new list.
*
* The shortest list determines the size of the result.
*
* @complexity `O(log(n))` where `n` is the length of the smallest
* list.
*/
export declare function zipWith_(as: List, bs: List, f: (a: A, b: B) => C): List;
/**
* This is like mapping over two lists at the same time. The two lists
* are iterated over in parallel and each pair of elements is passed
* to the function. The returned values are assembled into a new list.
*
* The shortest list determines the size of the result.
*
* @complexity `O(log(n))` where `n` is the length of the smallest
* list.
*/
export declare function zipWith(bs: List, f: (a: A, b: B) => C): (as: List) => List;
/**
* Sort the given list by comparing values using the given function.
* The function receieves two values and should return `-1` if the
* first value is stricty larger than the second, `0` is they are
* equal and `1` if the first values is strictly smaller than the
* second.
*
* @complexity O(n * log(n))
*/
export declare function sortWith_(l: List, ord: Ord): List;
/**
* Sort the given list by comparing values using the given function.
* The function receieves two values and should return `-1` if the
* first value is stricty larger than the second, `0` is they are
* equal and `1` if the first values is strictly smaller than the
* second.
*
* @complexity O(n * log(n))
*/
export declare function sortWith(ord: Ord): (l: List) => List;
/**
* Returns a list of lists where each sublist's elements are all
* equal.
*/
export declare function group(l: List): List>;
/**
* Returns a list of lists where each sublist's elements are pairwise
* equal based on the given comparison function.
*
* Note that only adjacent elements are compared for equality. If all
* equal elements should be grouped together the list should be sorted
* before grouping.
*/
export declare function groupWith_(l: List, f: (a: A, b: A) => boolean): List>;
/**
* Returns a list of lists where each sublist's elements are pairwise
* equal based on the given comparison function.
*
* Note that only adjacent elements are compared for equality. If all
* equal elements should be grouped together the list should be sorted
* before grouping.
*/
export declare function groupWith(f: (a: A, b: A) => boolean): (l: List) => List>;
/**
* Inserts a separator between each element in a list.
*/
export declare function intersperse_(l: List, separator: A): List;
/**
* Inserts a separator between each element in a list.
*/
export declare function intersperse(separator: A): (l: List) => List;
/**
* Returns `true` if the given list is empty and `false` otherwise.
*/
export declare function isEmpty(l: List): boolean;
/**
* Builder
*/
export declare function builder(): ListBuilder;
export declare class ListBuilder {
private chunk;
constructor(chunk: MutableList);
append(a: A): ListBuilder;
build(): MutableList;
}
//# sourceMappingURL=core.d.ts.map