/** * Various functions to aid in working with readonly arrays. * * @since 0.10.0 */ import type { Applicative, Applicative1, Applicative2, Applicative2C, Applicative3, Applicative4 } from "fp-ts/Applicative"; import type { Either } from "fp-ts/Either"; import type { Endomorphism } from "fp-ts/Endomorphism"; import type { Eq } from "fp-ts/Eq"; import type { HKT, Kind, Kind2, Kind3, Kind4, URIS, URIS2, URIS3, URIS4 } from "fp-ts/HKT"; import type { Monad1, Monad2, Monad2C, Monad3, Monad3C, Monad4 } from "fp-ts/Monad"; import type { Option } from "fp-ts/Option"; import type { Ord } from "fp-ts/Ord"; import { type Predicate } from "fp-ts/Predicate"; import type { ReadonlyNonEmptyArray } from "fp-ts/ReadonlyNonEmptyArray"; import type { These } from "fp-ts/These"; /** * Like `fp-ts/ReadonlyArray::elem` but flipped, which the "V" suffix denotes. * * @example * import { elemV } from 'fp-ts-std/ReadonlyArray' * import { eqString } from 'fp-ts/Eq' * * const isLowerVowel = elemV(eqString)(['a', 'e', 'i', 'o', 'u']) * * assert.strictEqual(isLowerVowel('a'), true) * assert.strictEqual(isLowerVowel('b'), false) * * @category 3 Functions * @since 0.10.0 */ export declare const elemV: (eq: Eq) => (xs: readonly A[]) => Predicate; /** * Check if a predicate does not hold for any array member. * * @example * import { none } from 'fp-ts-std/ReadonlyArray' * import { Predicate } from 'fp-ts/Predicate' * * const isFive: Predicate = n => n === 5 * const noneAreFive = none(isFive) * * assert.strictEqual(noneAreFive([4, 4, 4]), true) * assert.strictEqual(noneAreFive([4, 5, 4]), false) * * @category 3 Functions * @since 0.10.0 */ export declare const none: (f: Predicate) => Predicate>; /** * Join an array of strings together into a single string using the supplied * separator. * * @example * import { join } from 'fp-ts-std/ReadonlyArray' * * const commaSepd = join(',') * * assert.strictEqual(commaSepd([]), '') * assert.strictEqual(commaSepd(['a']), 'a') * assert.strictEqual(commaSepd(['a', 'b', 'c']), 'a,b,c') * * @category 3 Functions * @since 0.10.0 */ export declare const join: (x: string) => (ys: ReadonlyArray) => string; /** * Like `fp-ts/Array::getEq`, but items are not required to be in the same * order to determine equivalence. This function is therefore less efficient, * and `getEq` should be preferred on ordered data. * * @example * import { getEq } from 'fp-ts/Array' * import { getDisorderedEq } from 'fp-ts-std/ReadonlyArray' * import { ordNumber } from 'fp-ts/Ord' * * const f = getEq(ordNumber) * const g = getDisorderedEq(ordNumber) * * assert.strictEqual(f.equals([1, 2, 3], [1, 3, 2]), false) * assert.strictEqual(g.equals([1, 2, 3], [1, 3, 2]), true) * * @category 1 Typeclass Instances * @since 0.10.0 */ export declare const getDisorderedEq: (ordA: Ord) => Eq; /** * Pluck the first item out of an array matching a predicate. Any further * matches will be left untouched. * * This can be thought of as analagous to `fp-ts/Array::findFirst` where * the remaining items, sans the match (if any), are returned as well. * * @example * import { pluckFirst } from 'fp-ts-std/ReadonlyArray' * import * as O from 'fp-ts/Option' * import { Predicate } from 'fp-ts/Predicate' * * const isOverFive: Predicate = n => n > 5 * const pluckFirstOverFive = pluckFirst(isOverFive) * * assert.deepStrictEqual(pluckFirstOverFive([1, 3, 5]), [O.none, [1, 3, 5]]) * assert.deepStrictEqual(pluckFirstOverFive([1, 3, 5, 7, 9]), [O.some(7), [1, 3, 5, 9]]) * * @category 3 Functions * @since 0.10.0 */ export declare const pluckFirst: (p: Predicate) => (xs: readonly A[]) => [Option, readonly A[]]; /** * Update an item in an array or, if it's not present yet, insert it. * * If the item exists more than once (as determined by the supplied `Eq` * instance), only the first to be found will be updated. The order in which * the array is checked is unspecified. * * @example * import { upsert } from 'fp-ts-std/ReadonlyArray' * import { eqString, contramap } from 'fp-ts/Eq' * * type Account = { * id: string * name: string * } * * const eqAccount = contramap(acc => acc.id)(eqString) * * const accounts: ReadonlyArray = [{ * id: 'a', * name: 'an account', * }, { * id: 'b', * name: 'another account', * }] * * const created: Account = { * id: 'c', * name: 'yet another account', * } * * const updated: Account = { * id: 'b', * name: 'renamed account name', * } * * const upsertAccount = upsert(eqAccount) * * assert.deepStrictEqual(upsertAccount(created)(accounts), [accounts[0], accounts[1], created]) * assert.deepStrictEqual(upsertAccount(updated)(accounts), [accounts[0], updated]) * * @category 3 Functions * @since 0.10.0 */ export declare const upsert: (eqA: Eq) => (x: A) => (ys: readonly A[]) => ReadonlyNonEmptyArray; /** * Insert all the elements of an array into another array at the specified * index. Returns `None` if the index is out of bounds. * * The array of elements to insert must be non-empty. * * @example * import { insertMany } from 'fp-ts-std/ReadonlyArray' * import * as O from 'fp-ts/Option' * * const f = insertMany(1)(['a', 'b']) * assert.deepStrictEqual(f([]), O.none) * assert.deepStrictEqual(f(['x']), O.some(['x', 'a', 'b'])) * assert.deepStrictEqual(f(['x', 'y']), O.some(['x', 'a', 'b', 'y'])) * * @category 3 Functions * @since 0.5.0 */ export declare const insertMany: (i: number) => (xs: ReadonlyNonEmptyArray) => (ys: readonly A[]) => Option>; /** * Filter a list, removing any elements that repeat that directly precede them. * * @example * import { dropRepeats } from 'fp-ts-std/ReadonlyArray' * import { eqNumber } from 'fp-ts/Eq' * * assert.deepStrictEqual(dropRepeats(eqNumber)([1, 2, 2, 3, 2, 4, 4]), [1, 2, 3, 2, 4]) * * @category 3 Functions * @since 0.10.0 */ export declare const dropRepeats: (eq: Eq) => Endomorphism>; /** * Check if an array starts with the specified subarray. * * @example * import { startsWith } from 'fp-ts-std/ReadonlyArray' * import { eqString } from 'fp-ts/Eq' * * const startsXyz = startsWith(eqString)(['x', 'y', 'z']) * * assert.strictEqual(startsXyz(['x', 'y', 'z', 'a']), true) * assert.strictEqual(startsXyz(['a', 'x', 'y', 'z']), false) * * @category 3 Functions * @since 0.10.0 */ export declare const startsWith: (eq: Eq) => (start: readonly A[]) => Predicate; /** * Check if an array ends with the specified subarray. * * @example * import { endsWith } from 'fp-ts-std/ReadonlyArray' * import { eqString } from 'fp-ts/Eq' * * const endsXyz = endsWith(eqString)(['x', 'y', 'z']) * * assert.strictEqual(endsXyz(['a', 'x', 'y', 'z']), true) * assert.strictEqual(endsXyz(['a', 'x', 'b', 'z']), false) * * @category 3 Functions * @since 0.10.0 */ export declare const endsWith: (eq: Eq) => (end: readonly A[]) => Predicate; /** * Returns a new array without the values present in the first input array. * * @example * import { without } from 'fp-ts-std/ReadonlyArray' * import { eqNumber } from 'fp-ts/Eq' * * const withoutFourOrFive = without(eqNumber)([4, 5]) * * assert.deepStrictEqual(withoutFourOrFive([3, 4]), [3]) * assert.deepStrictEqual(withoutFourOrFive([4, 5]), []) * assert.deepStrictEqual(withoutFourOrFive([4, 5, 6]), [6]) * assert.deepStrictEqual(withoutFourOrFive([3, 4, 5, 6]), [3, 6]) * assert.deepStrictEqual(withoutFourOrFive([4, 3, 4, 5, 6, 5]), [3, 6]) * * @category 3 Functions * @since 0.10.0 */ export declare const without: (eq: Eq) => (xs: readonly A[]) => Endomorphism; /** * Returns the {@link https://en.wikipedia.org/wiki/Cartesian_product Cartesian product} * of two arrays. In other words, returns an array containing tuples of every * possible ordered combination of the two input arrays. * * @example * import { cartesian } from 'fp-ts-std/ReadonlyArray' * * assert.deepStrictEqual( * cartesian([1, 2])(['a', 'b', 'c']), * [[1, 'a'], [1, 'b'], [1, 'c'], [2, 'a'], [2, 'b'], [2, 'c']], * ) * * @category 3 Functions * @since 0.10.0 */ export declare const cartesian: (xs: readonly A[]) => (ys: readonly B[]) => readonly [A, B][]; /** * Adds together all the numbers in the input array. * * @example * import { sum } from 'fp-ts-std/ReadonlyArray' * * assert.strictEqual(sum([]), 0) * assert.strictEqual(sum([25, 3, 10]), 38) * * @category 3 Functions * @since 0.10.0 */ export declare const sum: (xs: ReadonlyArray) => number; /** * Multiplies together all the numbers in the input array. * * @example * import { product } from 'fp-ts-std/ReadonlyArray' * * assert.strictEqual(product([]), 1) * assert.strictEqual(product([5]), 5) * assert.strictEqual(product([4, 2, 3]), 24) * * @category 3 Functions * @since 0.10.0 */ export declare const product: (xs: ReadonlyArray) => number; /** * Calculate the mean of an array of numbers. * * @example * import { mean } from 'fp-ts-std/ReadonlyArray' * * assert.deepStrictEqual(mean([2, 7, 9]), 6) * * @category 3 Functions * @since 0.10.0 */ export declare const mean: (xs: ReadonlyNonEmptyArray) => number; /** * Calculate the median of an array of numbers. * * @example * import { median } from 'fp-ts-std/ReadonlyArray' * * assert.deepStrictEqual(median([2, 9, 7]), 7) * assert.deepStrictEqual(median([7, 2, 10, 9]), 8) * * @category 3 Functions * @since 0.10.0 */ export declare const median: (xs: ReadonlyNonEmptyArray) => number; /** * Returns an array of tuples of the specified length occupied by consecutive * elements. * * If `n` is not a positive number, an empty array is returned. * * If `n` is greater than the length of the array, an empty array is returned. * * @example * import { aperture } from 'fp-ts-std/ReadonlyArray' * * assert.deepStrictEqual(aperture(1)([1, 2, 3, 4]), [[1], [2], [3], [4]]) * assert.deepStrictEqual(aperture(2)([1, 2, 3, 4]), [[1, 2], [2, 3], [3, 4]]) * assert.deepStrictEqual(aperture(3)([1, 2, 3, 4]), [[1, 2, 3], [2, 3, 4]]) * assert.deepStrictEqual(aperture(4)([1, 2, 3, 4]), [[1, 2, 3, 4]]) * * @category 3 Functions * @since 0.10.0 */ export declare const aperture: (n: number) => (xs: readonly A[]) => readonly (readonly A[])[]; /** * Returns the elements of the array between the start index (inclusive) and the * end index (exclusive). * * This is merely a functional wrapper around `Array.prototype.slice`. * * @example * import { slice } from 'fp-ts-std/ReadonlyArray' * * const xs = ['a', 'b', 'c', 'd'] * * assert.deepStrictEqual(slice(1)(3)(xs), ['b', 'c']) * assert.deepStrictEqual(slice(1)(Infinity)(xs), ['b', 'c', 'd']) * assert.deepStrictEqual(slice(0)(-1)(xs), ['a', 'b', 'c']) * assert.deepStrictEqual(slice(-3)(-1)(xs), ['b', 'c']) * * @category 3 Functions * @since 0.10.0 */ export declare const slice: (start: number) => (end: number) => (xs: readonly A[]) => readonly A[]; /** * Filters out items in the array for which the predicate holds. This can be * thought of as the inverse of ordinary array filtering. * * @example * import { reject } from 'fp-ts-std/ReadonlyArray' * import { Predicate } from 'fp-ts/Predicate' * * const isEven: Predicate = n => n % 2 === 0 * * assert.deepStrictEqual(reject(isEven)([1, 2, 3, 4]), [1, 3]) * * @category 3 Functions * @since 0.10.0 */ export declare const reject: (f: Predicate) => (xs: readonly B[]) => readonly B[]; /** * Move an item at index `from` to index `to`. See also `moveTo`. * * If either index is out of bounds, `None` is returned. * * If both indices are the same, the array is returned unchanged. * * @example * import { moveFrom } from 'fp-ts-std/ReadonlyArray' * import * as O from 'fp-ts/Option' * * assert.deepStrictEqual(moveFrom(0)(1)(['a', 'b', 'c']), O.some(['b', 'a', 'c'])) * assert.deepStrictEqual(moveFrom(1)(1)(['a', 'b', 'c']), O.some(['a', 'b', 'c'])) * assert.deepStrictEqual(moveFrom(0)(0)([]), O.none) * assert.deepStrictEqual(moveFrom(0)(1)(['a']), O.none) * assert.deepStrictEqual(moveFrom(1)(0)(['a']), O.none) * * @category 3 Functions * @since 0.10.0 */ export declare const moveFrom: (from: number) => (to: number) => (xs: readonly A[]) => Option; /** * Move an item at index `from` to index `to`. See also `moveFrom`. * * If either index is out of bounds, `None` is returned. * * If both indices are the same, the array is returned unchanged. * * @example * import { moveTo } from 'fp-ts-std/ReadonlyArray' * import * as O from 'fp-ts/Option' * * assert.deepStrictEqual(moveTo(1)(0)(['a', 'b', 'c']), O.some(['b', 'a', 'c'])) * assert.deepStrictEqual(moveTo(1)(1)(['a', 'b', 'c']), O.some(['a', 'b', 'c'])) * assert.deepStrictEqual(moveTo(0)(0)([]), O.none) * assert.deepStrictEqual(moveTo(0)(1)(['a']), O.none) * assert.deepStrictEqual(moveTo(1)(0)(['a']), O.none) * * @category 3 Functions * @since 0.10.0 */ export declare const moveTo: (b: number) => (a: number) => (xs: readonly A[]) => Option; /** * Map each item of an array to a key, and count how many map to each key. * * @example * import { countBy } from 'fp-ts-std/ReadonlyArray' * import * as S from 'fp-ts/string' * * const f = countBy(S.toLowerCase) * const xs = ['A', 'b', 'C', 'a', 'e', 'A'] * * assert.deepStrictEqual(f(xs), { a: 3, b: 1, c: 1, e: 1 }) * * @category 3 Functions * @since 0.10.0 */ export declare const countBy: (f: (x: A) => string) => (xs: readonly A[]) => Record; /** * Remove the longest initial subarray from the end of the input array for * which all elements satisfy the specified predicate, creating a new array. * * @example * import { dropRightWhile } from 'fp-ts-std/ReadonlyArray' * import { Predicate } from 'fp-ts/Predicate' * * const isEven: Predicate = n => n % 2 === 0 * const dropRightEvens = dropRightWhile(isEven) * * assert.deepStrictEqual(dropRightEvens([6, 7, 3, 4, 2]), [6, 7, 3]) * * @category 3 Functions * @since 0.10.0 */ export declare const dropRightWhile: (f: Predicate) => (xs: readonly B[]) => readonly B[]; /** * Drop a number of elements from the specified index an array, returning a * new array. * * If `i` is out of bounds, `None` will be returned. * * If `i` is a float, it will be rounded down to the nearest integer. * * If `n` is larger than the available number of elements from the provided * index, only the elements prior to said index will be returned. * * If `n` is not a positive number, the array will be returned whole. * * If `n` is a float, it will be rounded down to the nearest integer. * * @example * import { dropAt } from 'fp-ts-std/ReadonlyArray' * import * as O from 'fp-ts/Option' * * assert.deepStrictEqual(dropAt(2)(0)(['a', 'b', 'c', 'd', 'e', 'f', 'g']), O.some(['a', 'b', 'c', 'd', 'e', 'f', 'g'])) * assert.deepStrictEqual(dropAt(2)(3)(['a', 'b', 'c', 'd', 'e', 'f', 'g']), O.some(['a', 'b', 'f', 'g'])) * assert.deepStrictEqual(dropAt(2)(Infinity)(['a', 'b', 'c', 'd', 'e', 'f', 'g']), O.some(['a', 'b'])) * * @category 3 Functions * @since 0.10.0 */ export declare const dropAt: (i: number) => (n: number) => (xs: readonly A[]) => Option; /** * Tranposes the rows and columns of a 2D list. If some of the rows are shorter * than the following rows, their elements are skipped. * * @example * import { transpose } from 'fp-ts-std/ReadonlyArray' * * assert.deepStrictEqual(transpose([[1, 2, 3], [4, 5, 6]]), [[1, 4], [2, 5], [3, 6]]) * assert.deepStrictEqual(transpose([[1, 4], [2, 5], [3, 6]]), [[1, 2, 3], [4, 5, 6]]) * assert.deepStrictEqual(transpose([[10, 11], [20], [], [30, 31,32]]), [[10, 20, 30], [11, 31], [32]]) * * @category 3 Functions * @since 0.10.0 */ export declare const transpose: (xs: readonly (readonly A[])[]) => readonly (readonly A[])[]; /** * Calculate the longest initial subarray from the end of the input array for * which all elements satisfy the specified predicate, creating a new array. * * @example * import { takeRightWhile } from 'fp-ts-std/ReadonlyArray' * import { Predicate } from 'fp-ts/Predicate' * * const isEven: Predicate = n => n % 2 === 0 * const takeRightEvens = takeRightWhile(isEven) * * assert.deepStrictEqual(takeRightEvens([6, 7, 3, 4, 2]), [4, 2]) * * @category 3 Functions * @since 0.10.0 */ export declare const takeRightWhile: (f: Predicate) => (xs: readonly B[]) => readonly B[]; /** * Creates an array of all values which are present in one of the two input * arrays, but not both. The order is determined by the input arrays and * duplicate values present only in one input array are maintained. * * @example * import { symmetricDifference } from 'fp-ts-std/ReadonlyArray' * import { eqNumber } from 'fp-ts/Eq' * * assert.deepStrictEqual(symmetricDifference(eqNumber)([1, 2, 3, 4])([3, 4, 5, 6]), [1, 2, 5, 6]) * assert.deepStrictEqual(symmetricDifference(eqNumber)([1, 7, 7, 4, 3])([3, 4, 9, 6]), [1, 7, 7, 9, 6]) * * @category 3 Functions * @since 0.10.0 */ export declare const symmetricDifference: (eq: Eq) => (xs: readonly A[]) => Endomorphism; /** * Like ordinary array reduction, however this also takes a predicate that is * evaluated before each step. If the predicate doesn't hold, the reduction * short-circuits and returns the current accumulator value. * * @example * import { reduceWhile } from 'fp-ts-std/ReadonlyArray' * import { add } from 'fp-ts-std/Number' * import { Predicate } from 'fp-ts/Predicate' * * const isEven: Predicate = n => n % 2 === 0 * const reduceUntilOdd = reduceWhile(isEven) * * assert.strictEqual(reduceUntilOdd(add)(0)([2, 4, 6, 9, 10]), 12) * * @category 3 Functions * @since 0.10.0 */ export declare const reduceWhile: (p: Predicate) => (f: (x: A) => (y: B) => B) => (x: B) => (ys: readonly A[]) => B; /** * Like ordinary array reduction, however this also takes a predicate that is * evaluated before each step. If the predicate doesn't hold, the reduction * short-circuits and returns the current accumulator value. * * @example * import { reduceRightWhile } from 'fp-ts-std/ReadonlyArray' * import { add } from 'fp-ts-std/Number' * import { Predicate } from 'fp-ts/Predicate' * * const isEven: Predicate = n => n % 2 === 0 * const reduceRightUntilOdd = reduceRightWhile(isEven) * * assert.strictEqual(reduceRightUntilOdd(add)(0)([2, 4, 7, 8, 10]), 18) * * @category 3 Functions * @since 0.10.0 */ export declare const reduceRightWhile: (p: Predicate) => (f: (x: A) => (y: B) => B) => (x: B) => (ys: readonly A[]) => B; /** * Obtain the minimum value from a non-empty array. * * @example * import { minimum } from 'fp-ts-std/ReadonlyArray' * import { ordNumber } from 'fp-ts/Ord' * * assert.strictEqual(minimum(ordNumber)([2, 3, 1, 5, 4]), 1) * * @category 3 Functions * @since 0.10.0 */ export declare const minimum: (ord: Ord) => (xs: ReadonlyNonEmptyArray) => A; /** * Obtain the maximum value from a non-empty array. * * @example * import { maximum } from 'fp-ts-std/ReadonlyArray' * import { ordNumber } from 'fp-ts/Ord' * * assert.strictEqual(maximum(ordNumber)([2, 3, 1, 5, 4]), 5) * * @category 3 Functions * @since 0.10.0 */ export declare const maximum: (ord: Ord) => (xs: ReadonlyNonEmptyArray) => A; /** * Greedy zip, preserving all items and expressing the possibility of unequal * input sizes via the `These` type. * * @example * import { zipAll } from 'fp-ts-std/ReadonlyArray' * import * as T from 'fp-ts/These' * * assert.deepStrictEqual(zipAll([3, 4, 5, 6])([1, 2]), [T.both(1, 3), T.both(2, 4), T.right(5), T.right(6)]) * * @category 3 Functions * @since 0.11.0 */ export declare const zipAll: (xs: readonly A[]) => (ys: readonly B[]) => readonly These[]; /** * Filter an array based upon a predicate whose boolean is returned in an * applicative context. This can be helpful if your predicate is asynchronous * and therefore `Task`-based, for example. * * @example * import * as T from "fp-ts/Task" * import { Task } from "fp-ts/Task" * import { filterA } from "fp-ts-std/ReadonlyArray" * * const asyncIsEven = (n: number): Task => T.of(n % 2 === 0) * * filterA(T.ApplicativePar)(asyncIsEven)([1, 2, 3, 4, 5])().then((xs) => { * assert.deepStrictEqual(xs, [2, 4]) * }) * * @category 2 Typeclass Methods * @since 0.12.0 */ export declare function filterA(F: Applicative4): (p: (x: A) => Kind4) => (xs: ReadonlyArray) => Kind4>; export declare function filterA(F: Applicative3): (p: (x: A) => Kind3) => (xs: ReadonlyArray) => Kind3>; export declare function filterA(F: Applicative2): (p: (x: A) => Kind2) => (xs: ReadonlyArray) => Kind2>; export declare function filterA(F: Applicative2C): (p: (x: A) => Kind2) => (xs: ReadonlyArray) => Kind2>; export declare function filterA(F: Applicative1): (p: (x: A) => Kind) => (xs: ReadonlyArray) => Kind>; export declare function filterA(F: Applicative): (p: (x: A) => HKT) => (xs: ReadonlyArray) => HKT>; /** * Remove the element at the specified index, returning both said element and * the remaining array. Returns `None` if the index is out of bounds. * * @example * import { extractAt } from 'fp-ts-std/ReadonlyArray' * import * as O from 'fp-ts/Option' * * const f = extractAt(1) * assert.deepStrictEqual(f(['x']), O.none) * assert.deepStrictEqual(f(['x', 'y']), O.some(['y', ['x']])) * assert.deepStrictEqual(f(['x', 'y', 'z']), O.some(['y', ['x', 'z']])) * * @category 3 Functions * @since 0.12.0 */ export declare const extractAt: (i: number) => (xs: readonly A[]) => Option<[A, readonly A[]]>; /** * Convert an `Iterable` to a `ReadonlyArray`. * * @example * import { fromIterable } from 'fp-ts-std/ReadonlyArray' * * assert.deepStrictEqual(fromIterable('hello'), ['h', 'e', 'l', 'l', 'o']) * * @category 3 Functions * @since 0.14.0 */ export declare const fromIterable: (xs: Iterable) => ReadonlyArray; /** * Fold a readonly array of monadic booleans from left-to-right in terms of &&. * Short-circuits. * * @example * import { allM } from 'fp-ts-std/ReadonlyArray' * import * as IO from 'fp-ts/IO' * import { execute } from 'fp-ts-std/IO' * * const f = allM(IO.Monad) * * assert.strictEqual(execute(f([IO.of(true), IO.of(true), IO.of(true)])), true) * assert.strictEqual(execute(f([IO.of(true), IO.of(false), IO.of(true)])), false) * * @category 2 Typeclass Methods * @since 0.15.0 */ export declare function allM(M: Monad4): (xs: ReadonlyArray>) => Kind4; export declare function allM(M: Monad3): (xs: ReadonlyArray>) => Kind3; export declare function allM(M: Monad3C): (xs: ReadonlyArray>) => Kind3; export declare function allM(M: Monad2): (xs: ReadonlyArray>) => Kind2; export declare function allM(M: Monad2C): (xs: ReadonlyArray>) => Kind2; export declare function allM(M: Monad1): (xs: ReadonlyArray>) => Kind; /** * Fold an array of monadic booleans from left-to-right in terms of ||. * Short-circuits. * * @example * import { anyM } from 'fp-ts-std/ReadonlyArray' * import * as IO from 'fp-ts/IO' * import { execute } from 'fp-ts-std/IO' * * const f = anyM(IO.Monad) * * assert.strictEqual(execute(f([IO.of(false), IO.of(false), IO.of(false)])), false) * assert.strictEqual(execute(f([IO.of(false), IO.of(true), IO.of(false)])), true) * * @category 2 Typeclass Methods * @since 0.15.0 */ export declare function anyM(M: Monad4): (xs: ReadonlyArray>) => Kind4; export declare function anyM(M: Monad3): (xs: ReadonlyArray>) => Kind3; export declare function anyM(M: Monad3C): (xs: ReadonlyArray>) => Kind3; export declare function anyM(M: Monad2): (xs: ReadonlyArray>) => Kind2; export declare function anyM(M: Monad2C): (xs: ReadonlyArray>) => Kind2; export declare function anyM(M: Monad1): (xs: ReadonlyArray>) => Kind; /** * Like `separate`, but records via `These` which of the partitions are * non-empty. * * @example * import { separateNE } from 'fp-ts-std/ReadonlyArray' * import * as E from 'fp-ts/Either' * import * as T from 'fp-ts/These' * * assert.deepStrictEqual( * separateNE([E.left(1), E.right('two')]), * T.both([1], ['two']), * ) * * assert.deepStrictEqual( * separateNE([E.right('one')]), * T.right(['one']), * ) * * @category 3 Functions * @since 0.16.0 */ export declare const separateNE: (xs: ReadonlyNonEmptyArray>) => These, ReadonlyNonEmptyArray>; //# sourceMappingURL=ReadonlyArray.d.ts.map