/**
 * adapted from https://github.com/gcanti/fp-ts
 */
import "../../../Operator";
import type { Either } from "../../../Either/core";
import type { Predicate, Refinement } from "../../../Function/core";
import type { Option } from "../../../Option";
import type { MutableArray } from "../../../Support/Mutable";
import type { Separated } from "../../../Utils";
import type { Dictionary } from "../Dictionary";
import type { NonEmptyArray } from "../NonEmptyArray";
import * as Tp from "../Tuple";
export declare type Array<A> = ReadonlyArray<A>;
/**
 * Classic Applicative's ap
 */
export declare function ap<A>(fa: Array<A>): <B>(fab: Array<(a: A) => B>) => Array<B>;
/**
 * Classic Applicative's ap
 */
export declare function ap_<A, B>(fab: Array<(a: A) => B>, fa: Array<A>): Array<B>;
/**
 * Composes computations in sequence, using the return value of one computation to determine the next computation.
 */
export declare function chain<A, B>(f: (a: A) => Array<B>): (ma: Array<A>) => Array<B>;
/**
 * Composes computations in sequence, using the return value of one computation to determine the next computation.
 */
export declare function chain_<A, B>(fa: Array<A>, f: (a: A) => Array<B>): Array<B>;
/**
 * Like chain but ignores output
 */
export declare function tap<A, B>(f: (a: A) => Array<B>): (ma: Array<A>) => Array<A>;
/**
 * Like chain but ignores output
 */
export declare function tap_<A, B>(ma: Array<A>, f: (a: A) => Array<B>): Array<A>;
/**
 * A useful recursion pattern for processing an array to produce a new array, often used for "chopping" up the input
 * array. Typically chop is called with some function that will consume an initial prefix of the array and produce a
 * value and the rest of the array.
 */
export declare function chop<A, B>(f: (as: NonEmptyArray<A>) => Tp.Tuple<[B, Array<A>]>): (as: Array<A>) => Array<B>;
/**
 * A useful recursion pattern for processing an array to produce a new array, often used for "chopping" up the input
 * array. Typically chop is called with some function that will consume an initial prefix of the array and produce a
 * value and the rest of the array.
 */
export declare function chop_<A, B>(as: Array<A>, f: (as: NonEmptyArray<A>) => Tp.Tuple<[B, Array<A>]>): Array<B>;
/**
 * Splits an array into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of
 * the array. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive
 * definition of `chunksOf`; it satisfies the property that
 *
 * ```ts
 * chunksOf(n)(xs).concat(chunksOf(n)(ys)) == chunksOf(n)(xs.concat(ys)))
 * ```
 *
 * whenever `n` evenly divides the length of `xs`.
 */
export declare function chunksOf(n: number): <A>(as: Array<A>) => Array<Array<A>>;
/**
 * Splits an array into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of
 * the array. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive
 * definition of `chunksOf`; it satisfies the property that
 *
 * ```ts
 * chunksOf(n)(xs).concat(chunksOf(n)(ys)) == chunksOf(n)(xs.concat(ys)))
 * ```
 *
 * whenever `n` evenly divides the length of `xs`.
 */
export declare function chunksOf_<A>(as: Array<A>, n: number): Array<Array<A>>;
/**
 * Filter out optional values
 */
export declare function compact<A>(fa: Array<Option<A>>): Array<A>;
/**
 * Array comprehension
 *
 * ```
 * [ f(x, y, ...) | x ← xs, y ← ys, ..., g(x, y, ...) ]
 * ```
 *
 * ```ts
 * assert.deepStrictEqual(comprehension([[1, 2, 3], ['a', 'b']], tuple, (a, b) => (a + b.length) % 2 === 0), [
 *   [1, 'a'],
 *   [1, 'b'],
 *   [3, 'a'],
 *   [3, 'b']
 * ])
 * ```
 */
export declare function comprehension<A, B, C, D, R>(input: readonly [Array<A>, Array<B>, Array<C>, Array<D>], f: (a: A, b: B, c: C, d: D) => R, g?: (a: A, b: B, c: C, d: D) => boolean): Array<R>;
export declare function comprehension<A, B, C, R>(input: readonly [Array<A>, Array<B>, Array<C>], f: (a: A, b: B, c: C) => R, g?: (a: A, b: B, c: C) => boolean): Array<R>;
export declare function comprehension<A, R>(input: readonly [Array<A>], f: (a: A) => R, g?: (a: A) => boolean): Array<R>;
export declare function comprehension<A, B, R>(input: readonly [Array<A>, Array<B>], f: (a: A, b: B) => R, g?: (a: A, b: B) => boolean): Array<R>;
export declare function comprehension<A, R>(input: readonly [Array<A>], f: (a: A) => boolean, g?: (a: A) => R): Array<R>;
/**
 * Concatenate
 */
export declare function concat_<A, A1>(x: Array<A>, y: Array<A1>): Array<A | A1>;
/**
 * Concatenate
 */
export declare function concat<A1>(y: Array<A1>): <A>(x: Array<A>) => Array<A1 | A>;
/**
 * Concatenate strictly
 */
export declare function concatS_<A>(x: Array<A>, y: Array<A>): Array<A>;
/**
 * Concatenate strictly
 */
export declare function concatS<A>(y: Array<A>): (x: Array<A>) => Array<A>;
/**
 * Attaches an element to the front of an array, creating a new non empty array
 *
 * ```ts
 * assert.deepStrictEqual(cons(0, [1, 2, 3]), [0, 1, 2, 3])
 * ```
 */
export declare function cons_<A>(tail: Array<A>, head: A): Array<A>;
/**
 * Attaches an element to the front of an array, creating a new non empty array
 */
export declare function cons<A>(head: A): (tail: Array<A>) => Array<A>;
/**
 * Delete the element at the specified index, creating a new array, or returning `None` if the index is out of bounds
 *
 * ```ts
 * assert.deepStrictEqual(deleteAt(0)([1, 2, 3]), some([2, 3]))
 * assert.deepStrictEqual(deleteAt(1)([]), none)
 * ```
 */
export declare function deleteAt(i: number): <A>(as: Array<A>) => Option<Array<A>>;
/**
 * Delete the element at the specified index, creating a new array, or returning `None` if the index is out of bounds
 */
export declare function deleteAt_<A>(as: Array<A>, i: number): Option<Array<A>>;
/**
 * Drop a number of elements from the start of an array, creating a new array
 *
 * ```ts
 * assert.deepStrictEqual(dropLeft(2)([1, 2, 3]), [3])
 * ```
 */
export declare function dropLeft(n: number): <A>(as: Array<A>) => Array<A>;
/**
 * Drop a number of elements from the start of an array, creating a new array
 */
export declare function dropLeft_<A>(as: Array<A>, n: number): Array<A>;
/**
 * Remove the longest initial subarray for which all element satisfy the specified predicate, creating a new array
 *
 * ```ts
 * assert.deepStrictEqual(dropLeftWhile((n: number) => n % 2 === 1)([1, 3, 2, 4, 5]), [2, 4, 5])
 * ```
 */
export declare function dropLeftWhile<A>(predicate: Predicate<A>): (as: Array<A>) => Array<A>;
/**
 * Remove the longest initial subarray for which all element satisfy the specified predicate, creating a new array
 *
 * ```
 * assert.deepStrictEqual(dropLeftWhile((n: number) => n % 2 === 1)([1, 3, 2, 4, 5]), [2, 4, 5])
 * ```
 */
export declare function dropLeftWhile_<A>(as: Array<A>, predicate: Predicate<A>): Array<A>;
/**
 * Drop a number of elements from the end of an array, creating a new array
 *
 * ```
 * assert.deepStrictEqual(dropRight(2)([1, 2, 3, 4, 5]), [1, 2, 3])
 * ```
 */
export declare function dropRight(n: number): <A>(as: Array<A>) => Array<A>;
/**
 * Drop a number of elements from the end of an array, creating a new array
 *
 * ```
 * assert.deepStrictEqual(dropRight(2)([1, 2, 3, 4, 5]), [1, 2, 3])
 * ```
 */
export declare function dropRight_<A>(as: Array<A>, n: number): Array<A>;
/**
 * Array[A] => Array[Array[A]]
 */
export declare function duplicate<A>(ma: Array<A>): Array<Array<A>>;
/**
 * An empty array
 */
export declare const empty: Array<never>;
/**
 * An empty array
 */
export declare const emptyOf: <A>() => Array<A>;
/**
 * Extends calls f with all the progressive slices up to the current element's index,
 * and uses the return value to construct the result array
 *
 * i.e: like map that also consumes all the elements up to `i`
 */
export declare function extend<A, B>(f: (fa: Array<A>) => B): (ma: Array<A>) => Array<B>;
/**
 * Extends calls f with all the progressive slices up to the current element's index,
 * and uses the return value to construct the result array
 *
 * i.e: like map that also consumes all the elements up to `i`
 */
export declare function extend_<A, B>(ma: Array<A>, f: (fa: Array<A>) => B): Array<B>;
/**
 * Filters the array
 */
export declare function filter<A, B extends A>(refinement: Refinement<A, B>): (fa: Array<A>) => Array<B>;
export declare function filter<A>(predicate: Predicate<A>): (fa: Array<A>) => Array<A>;
/**
 * Filters the array
 */
export declare function filter_<A, B extends A>(fa: Array<A>, refinement: Refinement<A, B>): Array<B>;
export declare function filter_<A>(fa: Array<A>, predicate: Predicate<A>): Array<A>;
/**
 * Filters the array also passing element index
 */
export declare function filterWithIndex<A>(predicate: (i: number, a: A) => boolean): (nea: Array<A>) => Array<A>;
/**
 * Filters the array also passing element index
 */
export declare function filterWithIndex_<A>(nea: Array<A>, predicate: (i: number, a: A) => boolean): Array<A>;
/**
 * Filters the array also mapping the output
 */
export declare const filterMap: <A, B>(f: (a: A) => Option<B>) => (fa: Array<A>) => Array<B>;
/**
 * Filters the array also mapping the output
 */
export declare function filterMap_<A, B>(fa: Array<A>, f: (a: A) => Option<B>): Array<B>;
/**
 * Filters the array also mapping the output
 */
export declare function filterMapWithIndex<A, B>(f: (i: number, a: A) => Option<B>): (fa: Array<A>) => Array<B>;
/**
 * Filters the array also mapping the output
 */
export declare function filterMapWithIndex_<A, B>(fa: Array<A>, f: (i: number, a: A) => Option<B>): Array<B>;
/**
 * Maps an array until `none` is returned
 */
export declare function collectWhileMap_<A, B>(arr: Array<A>, f: (x: A) => Option<B>): Array<B>;
/**
 * Maps an array until `none` is returned
 */
export declare function collectWhileMap<A, B>(f: (x: A) => Option<B>): (arr: Array<A>) => Array<B>;
/**
 * Find the first element which satisfies a predicate (or a refinement) function
 *
 * ```ts
 * assert.deepStrictEqual(findFirst((x: { a: number, b: number }) => x.a === 1)([{ a: 1, b: 1 }, { a: 1, b: 2 }]), some({ a: 1, b: 1 }))
 * ```
 */
export declare function findFirst<A, B extends A>(refinement: Refinement<A, B>): (as: Array<A>) => Option<B>;
export declare function findFirst<A>(predicate: Predicate<A>): (as: Array<A>) => Option<A>;
/**
 * Find the first element which satisfies a predicate (or a refinement) function
 */
export declare function findFirst_<A, B extends A>(as: Array<A>, refinement: Refinement<A, B>): Option<B>;
export declare function findFirst_<A>(as: Array<A>, predicate: Predicate<A>): Option<A>;
/**
 * Find the first element returned by an option based selector function
 *
 * ```ts
 * interface Person {
 *   name: string
 *   age?: number
 * }
 *
 * const persons: Array<Person> = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }]
 *
 * // returns the name of the first person that has an age
 * assert.deepStrictEqual(findFirstMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Mary'))
 * ```
 */
export declare function findFirstMap<A, B>(f: (a: A) => Option<B>): (as: Array<A>) => Option<B>;
/**
 * Find the first element returned by an option based selector function
 */
export declare function findFirstMap_<A, B>(as: Array<A>, f: (a: A) => Option<B>): Option<B>;
/**
 * Find the first index for which a predicate holds
 *
 * ```
 * assert.deepStrictEqual(findIndex((n: number) => n === 2)([1, 2, 3]), some(1))
 * assert.deepStrictEqual(findIndex((n: number) => n === 2)([]), none)
 * ```
 */
export declare function findIndex<A>(predicate: Predicate<A>): (as: Array<A>) => Option<number>;
/**
 * Find the first index for which a predicate holds
 */
export declare function findIndex_<A>(as: Array<A>, predicate: Predicate<A>): Option<number>;
/**
 * Find the last element which satisfies a predicate function
 *
 * ```
 * assert.deepStrictEqual(findLast((x: { a: number, b: number }) => x.a === 1)([{ a: 1, b: 1 }, { a: 1, b: 2 }]), some({ a: 1, b: 2 }))
 * ```
 */
export declare function findLast<A, B extends A>(refinement: Refinement<A, B>): (as: Array<A>) => Option<B>;
export declare function findLast<A>(predicate: Predicate<A>): (as: Array<A>) => Option<A>;
/**
 * Find the last element which satisfies a predicate function
 */
export declare function findLast_<A, B extends A>(as: Array<A>, refinement: Refinement<A, B>): Option<B>;
export declare function findLast_<A>(as: Array<A>, predicate: Predicate<A>): Option<A>;
/**
 * Returns the index of the last element of the list which matches the predicate
 *
 * ```ts
 * interface X {
 *   a: number
 *   b: number
 * }
 * const xs: Array<X> = [{ a: 1, b: 0 }, { a: 1, b: 1 }]
 * assert.deepStrictEqual(findLastIndex((x: { a: number }) => x.a === 1)(xs), some(1))
 * assert.deepStrictEqual(findLastIndex((x: { a: number }) => x.a === 4)(xs), none)
 * ```
 */
export declare function findLastIndex<A>(predicate: Predicate<A>): (as: Array<A>) => Option<number>;
/**
 * Returns the index of the last element of the list which matches the predicate
 */
export declare function findLastIndex_<A>(as: Array<A>, predicate: Predicate<A>): Option<number>;
/**
 * Find the last element returned by an option based selector function
 *
 * ```ts
 * interface Person {
 *   name: string
 *   age?: number
 * }
 *
 * const persons: Array<Person> = [{ name: 'John' }, { name: 'Mary', age: 45 }, { name: 'Joey', age: 28 }]
 *
 * // returns the name of the last person that has an age
 * assert.deepStrictEqual(findLastMap((p: Person) => (p.age === undefined ? none : some(p.name)))(persons), some('Joey'))
 * ```
 */
export declare function findLastMap<A, B>(f: (a: A) => Option<B>): (as: Array<A>) => Option<B>;
/**
 * Find the last element returned by an option based selector function
 */
export declare function findLastMap_<A, B>(as: Array<A>, f: (a: A) => Option<B>): Option<B>;
/**
 * Removes one level of nesting
 *
 * ```ts
 * assert.deepStrictEqual(flatten([[1], [2], [3]]), [1, 2, 3])
 * ```
 */
export declare function flatten<A>(mma: Array<Array<A>>): Array<A>;
/**
 * Break an array into its first element and remaining elements
 *
 * ```ts
 * const len: <A>(as: Array<A>) => number = foldLeft(() => 0, (_, tail) => 1 + len(tail))
 * assert.strictEqual(len([1, 2, 3]), 3)
 * ```
 */
export declare function foldLeft<A, B>(onNil: () => B, onCons: (head: A, tail: Array<A>) => B): (as: Array<A>) => B;
/**
 * Break an array into its first element and remaining elements
 */
export declare function foldLeft_<A, B>(as: Array<A>, onNil: () => B, onCons: (head: A, tail: Array<A>) => B): B;
/**
 * Break an array into its initial elements and the last element
 */
export declare function foldRight<A, B>(onNil: () => B, onCons: (init: Array<A>, last: A) => B): (as: Array<A>) => B;
/**
 * Break an array into its initial elements and the last element
 */
export declare function foldRight_<A, B>(as: Array<A>, onNil: () => B, onCons: (init: Array<A>, last: A) => B): B;
/**
 * Copies a mutable array into an immutable
 */
export declare function fromMutable<A>(as: MutableArray<A>): Array<A>;
/**
 * Get the first element in an array, or `None` if the array is empty
 *
 * ```ts
 * assert.deepStrictEqual(head([1, 2, 3]), some(1))
 * assert.deepStrictEqual(head([]), none)
 * ```
 */
export declare function head<A>(as: Array<A>): Option<A>;
/**
 * Get all but the last element of an array, creating a new array, or `None` if the array is empty
 *
 * ```
 * assert.deepStrictEqual(init([1, 2, 3]), some([1, 2]))
 * assert.deepStrictEqual(init([]), none)
 * ```
 */
export declare function init<A>(as: Array<A>): Option<Array<A>>;
/**
 * Insert an element at the specified index, creating a new array, or returning `None` if the index is out of bounds
 *
 * ```
 * assert.deepStrictEqual(insertAt(2, 5)([1, 2, 3, 4]), some([1, 2, 5, 3, 4]))
 * ```
 */
export declare function insertAt<A>(i: number, a: A): (as: Array<A>) => Option<Array<A>>;
/**
 * Insert an element at the specified index, creating a new array, or returning `None` if the index is out of bounds
 */
export declare function insertAt_<A>(as: Array<A>, i: number, a: A): Option<Array<A>>;
/**
 * Test whether an array is empty
 *
 * ```
 * assert.strictEqual(isEmpty([]), true)
 * ```
 */
export declare function isEmpty<A>(as: Array<A>): boolean;
/**
 * Test whether an array is non empty narrowing down the type to `NonEmptyArray<A>`
 */
export declare function isNonEmpty<A>(as: Array<A>): as is NonEmptyArray<A>;
/**
 * Test whether an array contains a particular index
 */
export declare function isOutOfBound<A>(i: number, as: Array<A>): boolean;
/**
 * Get the last element in an array, or `None` if the array is empty
 *
 * ```ts
 * assert.deepStrictEqual(last([1, 2, 3]), some(3))
 * assert.deepStrictEqual(last([]), none)
 * ```
 */
export declare function last<A>(as: Array<A>): Option<A>;
/**
 * Extracts from an array of `Either` all the `Left` elements. All the `Left` elements are extracted in order
 *
 * ```ts
 * assert.deepStrictEqual(lefts([right(1), left('foo'), right(2)]), ['foo'])
 * ```
 */
export declare function lefts<E, A>(as: Array<Either<E, A>>): Array<E>;
/**
 * This function provides a safe way to read a value at a particular index from an array
 *
 * ```ts
 * assert.deepStrictEqual(lookup(1, [1, 2, 3]), some(2))
 * assert.deepStrictEqual(lookup(3, [1, 2, 3]), none)
 * ```
 */
export declare function lookup_<A>(as: Array<A>, i: number): Option<A>;
/**
 * This function provides a safe way to read a value at a particular index from an array
 */
export declare function lookup(i: number): <A>(as: Array<A>) => Option<A>;
/**
 * Return a list of length `n` with element `i` initialized with `f(i)`
 *
 * ```ts
 * const double = (n: number): number => n * 2
 * assert.deepStrictEqual(makeBy_(5, double), [0, 2, 4, 6, 8])
 * ```
 */
export declare function makeBy_<A>(n: number, f: (i: number) => A): Array<A>;
/**
 * Return a list of length `n` with element `i` initialized with `f(i)`
 */
export declare function makeBy<A>(f: (i: number) => A): (n: number) => Array<A>;
/**
 * Apply f to every element of Array<A> returning Array<B>
 */
export declare function map<A, B>(f: (a: A) => B): (fa: Array<A>) => Array<B>;
/**
 * Apply f to every element of Array<A> returning Array<B>
 */
export declare function map_<A, B>(fa: Array<A>, f: (a: A) => B): Array<B>;
/**
 * Like map but also passes the index to f
 */
export declare function mapWithIndex<A, B>(f: (i: number, a: A) => B): (fa: Array<A>) => Array<B>;
/**
 * Like map but also passes the index to f
 */
export declare function mapWithIndex_<A, B>(fa: Array<A>, f: (i: number, a: A) => B): Array<B>;
/**
 * Apply a function to the element at the specified index, creating a new array, or returning `None` if the index is out
 * of bounds
 *
 * ```ts
 * const double = (x: number): number => x * 2
 * assert.deepStrictEqual(modifyAt(1, double)([1, 2, 3]), some([1, 4, 3]))
 * assert.deepStrictEqual(modifyAt(1, double)([]), none)
 * ```
 */
export declare function modifyAt<A>(i: number, f: (a: A) => A): (as: Array<A>) => Option<Array<A>>;
/**
 * Apply a function to the element at the specified index, creating a new array, or returning `None` if the index is out
 * of bounds
 */
export declare function modifyAt_<A>(as: Array<A>, i: number, f: (a: A) => A): Option<Array<A>>;
/**
 * Construct an array with a single element
 */
export declare function single<A>(a: A): Array<A>;
/**
 * Create an array containing a range of integers, including both endpoints
 *
 * ```ts
 * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5])
 * ```
 */
export declare function range(start: number, end: number): Array<number>;
/**
 * Construct B by compacting with f over the array from left to right
 */
export declare function reduce<A, B>(b: B, f: (b: B, a: A) => B): (fa: Array<A>) => B;
/**
 * Construct B by compacting with f over the array from left to right
 */
export declare function reduce_<A, B>(fa: Array<A>, b: B, f: (b: B, a: A) => B): B;
/**
 * Construct B by compacting with f over the array from right to left
 */
export declare function reduceRight<A, B>(b: B, f: (a: A, b: B) => B): (fa: Array<A>) => B;
/**
 * Construct B by compacting with f over the array from right to left
 */
export declare function reduceRight_<A, B>(fa: Array<A>, b: B, f: (a: A, b: B) => B): B;
/**
 * Construct B by compacting with f over the array from right to left
 */
export declare function reduceRightWithIndex<A, B>(b: B, f: (i: number, a: A, b: B) => B): (fa: Array<A>) => B;
/**
 * Construct B by compacting with f over the array from right to left
 */
export declare function reduceRightWithIndex_<A, B>(fa: Array<A>, b: B, f: (i: number, a: A, b: B) => B): B;
/**
 * Construct B by compacting with f over the array from left to right
 */
export declare function reduceWithIndex<A, B>(b: B, f: (i: number, b: B, a: A) => B): (fa: Array<A>) => B;
/**
 * Construct B by compacting with f over the array from left to right
 */
export declare function reduceWithIndex_<A, B>(fa: Array<A>, b: B, f: (i: number, b: B, a: A) => B): B;
/**
 * Create an array containing a value repeated the specified number of times
 *
 * ```ts
 * assert.deepStrictEqual(replicate_(3, 'a'), ['a', 'a', 'a'])
 * ```
 */
export declare function replicate_<A>(n: number, a: A): Array<A>;
/**
 * Create an array containing a value repeated the specified number of times
 *
 * ```ts
 * assert.deepStrictEqual(replicate_(3, 'a'), ['a', 'a', 'a'])
 * ```
 */
export declare function replicate<A>(a: A): (n: number) => Array<A>;
/**
 * Reverse an array, creating a new array
 *
 * ```ts
 * assert.deepStrictEqual(reverse([1, 2, 3]), [3, 2, 1])
 * ```
 */
export declare function reverse<A>(as: Array<A>): Array<A>;
/**
 * Extracts from an array of `Either` all the `Right` elements. All the `Right` elements are extracted in order
 *
 * ```ts
 * assert.deepStrictEqual(rights([right(1), left('foo'), right(2)]), [1, 2])
 * ```
 */
export declare function rights<E, A>(as: Array<Either<E, A>>): Array<A>;
/**
 * Rotate an array to the right by `n` steps
 *
 * ```ts
 * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3])
 * ```
 */
export declare function rotate(n: number): <A>(as: Array<A>) => Array<A>;
/**
 * Rotate an array to the right by `n` steps
 */
export declare function rotate_<A>(as: Array<A>, n: number): Array<A>;
/**
 * Same as `reduce` but it carries over the intermediate steps
 *
 * ```ts
 * import { scanLeft } from '@matechs/core/Array'
 *
 * assert.deepStrictEqual(scanLeft(10, (b, a: number) => b - a)([1, 2, 3]), [10, 9, 7, 4])
 * ```
 */
export declare function scanLeft<A, B>(b: B, f: (b: B, a: A) => B): (as: Array<A>) => Array<B>;
/**
 * Same as `reduce` but it carries over the intermediate steps
 */
export declare function scanLeft_<A, B>(as: Array<A>, b: B, f: (b: B, a: A) => B): Array<B>;
/**
 * Fold an array from the right, keeping all intermediate results instead of only the final result
 *
 * ```ts
 * assert.deepStrictEqual(scanRight(10, (a: number, b) => b - a)([1, 2, 3]), [4, 5, 7, 10])
 * ```
 */
export declare function scanRight<A, B>(b: B, f: (a: A, b: B) => B): (as: Array<A>) => Array<B>;
/**
 * Fold an array from the right, keeping all intermediate results instead of only the final result
 */
export declare function scanRight_<A, B>(as: Array<A>, b: B, f: (a: A, b: B) => B): Array<B>;
/**
 * Append an element to the end of an array, creating a new non empty array
 *
 * ```ts
 * assert.deepStrictEqual(snoc([1, 2, 3], 4), [1, 2, 3, 4])
 * ```
 */
export declare function snoc_<A>(init: Array<A>, end: A): Array<A>;
/**
 * Append an element to the end of an array, creating a new non empty array
 */
export declare function snoc<A>(end: A): (init: Array<A>) => Array<A>;
/**
 * Finds the first index that doesn't satisfy predicate or the length of as
 */
export declare const spanIndex_: <A>(as: Array<A>, predicate: Predicate<A>) => number;
/**
 * Split an array into two parts:
 * 1. the longest initial subarray for which all elements satisfy the specified predicate
 * 2. the remaining elements
 *
 * ```ts
 * assert.deepStrictEqual(spanLeft((n: number) => n % 2 === 1)([1, 3, 2, 4, 5]), { init: [1, 3], rest: [2, 4, 5] })
 * ```
 */
export declare function spanLeft<A, B extends A>(refinement: Refinement<A, B>): (as: Array<A>) => Spanned<B, A>;
export declare function spanLeft<A>(predicate: Predicate<A>): (as: Array<A>) => Spanned<A, A>;
/**
 * Split an array into two parts:
 * 1. the longest initial subarray for which all elements satisfy the specified predicate
 * 2. the remaining elements
 */
export declare function spanLeft_<A, B extends A>(as: Array<A>, refinement: Refinement<A, B>): Spanned<B, A>;
export declare function spanLeft_<A>(as: Array<A>, predicate: Predicate<A>): Spanned<A, A>;
export interface Spanned<I, R> {
    readonly init: Array<I>;
    readonly rest: Array<R>;
}
/**
 * Splits an array into two pieces, the first piece has `n` elements.
 *
 * ```ts
 * assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4, 5]])
 * ```
 */
export declare function splitAt(n: number): <A>(as: Array<A>) => Tp.Tuple<[Array<A>, Array<A>]>;
/**
 * Splits an array into two pieces, the first piece has `n` elements.
 */
export declare function splitAt_<A>(as: Array<A>, n: number): Tp.Tuple<[Array<A>, Array<A>]>;
/**
 * Get all but the first element of an array, creating a new array, or `None` if the array is empty
 *
 * ```ts
 * assert.deepStrictEqual(tail([1, 2, 3]), some([2, 3]))
 * assert.deepStrictEqual(tail([]), none)
 * ```
 */
export declare function tail<A>(as: Array<A>): Option<Array<A>>;
/**
 * Keep only a number of elements from the start of an array, creating a new array.
 * `n` must be a natural number
 *
 * ```ts
 * assert.deepStrictEqual(takeLeft(2)([1, 2, 3]), [1, 2])
 * ```
 */
export declare function takeLeft(n: number): <A>(as: Array<A>) => Array<A>;
/**
 * Keep only a number of elements from the start of an array, creating a new array.
 * `n` must be a natural number
 */
export declare function takeLeft_<A>(as: Array<A>, n: number): Array<A>;
/**
 * Calculate the longest initial subarray for which all element satisfy the specified predicate, creating a new array
 *
 * ```ts
 * assert.deepStrictEqual(takeLeftWhile((n: number) => n % 2 === 0)([2, 4, 3, 6]), [2, 4])
 * ```
 */
export declare function takeLeftWhile<A, B extends A>(refinement: Refinement<A, B>): (as: Array<A>) => Array<B>;
export declare function takeLeftWhile<A>(predicate: Predicate<A>): (as: Array<A>) => Array<A>;
/**
 * Calculate the longest initial subarray for which all element satisfy the specified predicate, creating a new array
 */
export declare function takeLeftWhile_<A, B extends A>(as: Array<A>, refinement: Refinement<A, B>): Array<B>;
export declare function takeLeftWhile_<A>(as: Array<A>, predicate: Predicate<A>): Array<A>;
/**
 * Takes elements until the predicate returns positively
 */
export declare function takeUntil<A, B extends A>(predicate: Refinement<A, B>): (as: Array<A>) => Array<B>;
export declare function takeUntil<A>(predicate: Predicate<A>): (as: Array<A>) => Array<A>;
/**
 * Takes elements until the predicate returns positively
 */
export declare function takeUntil_<A, B extends A>(as: Array<A>, predicate: Refinement<A, B>): Array<B>;
export declare function takeUntil_<A>(as: Array<A>, predicate: Predicate<A>): Array<A>;
/**
 * Keep only a number of elements from the end of an array, creating a new array.
 * `n` must be a natural number
 *
 * ```ts
 * assert.deepStrictEqual(takeRight(2)([1, 2, 3, 4, 5]), [4, 5])
 * ```
 */
export declare function takeRight(n: number): <A>(as: Array<A>) => Array<A>;
/**
 * Keep only a number of elements from the end of an array, creating a new array.
 * `n` must be a natural number
 */
export declare function takeRight_<A>(as: Array<A>, n: number): Array<A>;
/**
 * Copies this array into a mutable one
 */
export declare function toMutable<A>(ras: Array<A>): MutableArray<A>;
/**
 * Construct A by unfolding B signaling end with an option
 */
export declare function unfold_<A, B>(b: B, f: (b: B) => Option<Tp.Tuple<[A, B]>>): Array<A>;
/**
 * Construct A by unfolding B signaling end with an option
 */
export declare function unfold<A, B>(f: (b: B) => Option<Tp.Tuple<[A, B]>>): (b: B) => Array<A>;
/**
 * Deletes index i (non safe)
 */
export declare function unsafeDeleteAt_<A>(as: Array<A>, i: number): Array<A>;
/**
 * Deletes index i (non safe)
 */
export declare function unsafeDeleteAt(i: number): <A>(as: Array<A>) => Array<A>;
/**
 * Inserts index i (non safe)
 */
export declare function unsafeInsertAt_<A>(as: Array<A>, i: number, a: A): Array<A>;
/**
 * Inserts index i (non safe)
 */
export declare function unsafeInsertAt<A>(i: number, a: A): (as: Array<A>) => Array<A>;
/**
 * Updates index i (non safe)
 */
export declare function unsafeUpdateAt_<A>(as: Array<A>, i: number, a: A): Array<A>;
/**
 * Updates index i (non safe)
 */
export declare function unsafeUpdateAt<A>(i: number, a: A): (as: Array<A>) => Array<A>;
/**
 * The function is reverse of `zip`. Takes an array of pairs and return two corresponding arrays
 *
 * ```ts
 * assert.deepStrictEqual(unzip([[1, 'a'], [2, 'b'], [3, 'c']]), [[1, 2, 3], ['a', 'b', 'c']])
 * ```
 */
export declare function unzip<A, B>(as: Array<Tp.Tuple<[A, B]>>): Tp.Tuple<[Array<A>, Array<B>]>;
/**
 * Change the element at the specified index, creating a new array, or returning `None` if the index is out of bounds
 *
 * ```ts
 * assert.deepStrictEqual(updateAt(1, 1)([1, 2, 3]), some([1, 1, 3]))
 * assert.deepStrictEqual(updateAt(1, 1)([]), none)
 * ```
 */
export declare function updateAt<A>(i: number, a: A): (as: Array<A>) => Option<Array<A>>;
/**
 * Change the element at the specified index, creating a new array, or returning `None` if the index is out of bounds
 */
export declare function updateAt_<A>(as: Array<A>, i: number, a: A): Option<Array<A>>;
/**
 * Takes two arrays and returns an array of corresponding pairs. If one input array is short, excess elements of the
 * longer array are discarded
 *
 * ```ts
 * assert.deepStrictEqual(zip([1, 2, 3], ['a', 'b', 'c', 'd']), [[1, 'a'], [2, 'b'], [3, 'c']])
 * ```
 */
export declare function zip<B>(fb: Array<B>): <A>(fa: Array<A>) => Array<Tp.Tuple<[A, B]>>;
/**
 * Takes two arrays and returns an array of corresponding pairs. If one input array is short, excess elements of the
 * longer array are discarded
 */
export declare function zip_<A, B>(fa: Array<A>, fb: Array<B>): Array<Tp.Tuple<[A, B]>>;
/**
 * Apply a function to pairs of elements at the same index in two arrays, collecting the results in a new array. If one
 * input array is short, excess elements of the longer array are discarded.
 *
 * ```ts
 * assert.deepStrictEqual(zipWith([1, 2, 3], ['a', 'b', 'c', 'd'], (n, s) => s + n), ['a1', 'b2', 'c3'])
 * ```
 */
export declare function zipWith_<A, B, C>(fa: Array<A>, fb: Array<B>, f: (a: A, b: B) => C): Array<C>;
/**
 * Apply a function to pairs of elements at the same index in two arrays, collecting the results in a new array. If one
 * input array is short, excess elements of the longer array are discarded.
 */
export declare function zipWith<A, B, C>(fb: Array<B>, f: (a: A, b: B) => C): (fa: Array<A>) => Array<C>;
/**
 * Separate Array
 */
export declare function separate<B, C>(fa: Array<Either<B, C>>): Separated<Array<B>, Array<C>>;
/**
 * Drops elements while the predicate returns true
 */
export declare function dropWhile_<A>(as: ReadonlyArray<A>, predicate: Predicate<A>): ReadonlyArray<A>;
/**
 * Drops elements while the predicate returns true
 */
export declare function dropWhile<A>(predicate: Predicate<A>): (as: Array<A>) => Array<A>;
/**
 * Constructs a new readonly array from an interable.
 */
export declare function from<A>(as: Iterable<A>): Array<A>;
/**
 * Joins together string arrays
 */
export declare function join_(as: Array<string>, s: string): string;
/**
 * Joins together string arrays
 */
export declare function join(s: string): (as: Array<string>) => string;
/**
 * Splits an array into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning
 * function on each element, and grouping the results according to values returned
 */
export declare function groupBy<A>(f: (a: A) => string): (as: Array<A>) => Dictionary<NonEmptyArray<A>>;
/**
 * Splits an array into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning
 * function on each element, and grouping the results according to values returned
 */
export declare function groupBy_<A>(as: Array<A>, f: (a: A) => string): Dictionary<NonEmptyArray<A>>;
//# sourceMappingURL=index.d.ts.map