/** * Data structure which represents non-empty readonly arrays. * * ```ts * export type ReadonlyNonEmptyArray = ReadonlyArray & { * readonly 0: A * } * ``` * * Note that you don't need any conversion, a `ReadonlyNonEmptyArray` is a `ReadonlyArray`, * so all `ReadonlyArray`'s APIs can be used with a `ReadonlyNonEmptyArray` without further ado. * * @since 2.5.0 */ import { Alt1 } from './Alt' import { Applicative1 } from './Applicative' import { Apply1 } from './Apply' import { Chain1 } from './Chain' import { Comonad1 } from './Comonad' import { Endomorphism } from './Endomorphism' import { Eq } from './Eq' import { Foldable1 } from './Foldable' import { FoldableWithIndex1 } from './FoldableWithIndex' import { Lazy } from './function' import { Functor1 } from './Functor' import { FunctorWithIndex1 } from './FunctorWithIndex' import { Monad1 } from './Monad' import { Option } from './Option' import { Ord } from './Ord' import { Pointed1 } from './Pointed' import { Predicate } from './Predicate' import { ReadonlyRecord } from './ReadonlyRecord' import { Refinement } from './Refinement' import * as Se from './Semigroup' import { Show } from './Show' import { PipeableTraverse1, Traversable1 } from './Traversable' import { PipeableTraverseWithIndex1, TraversableWithIndex1 } from './TraversableWithIndex' import Semigroup = Se.Semigroup /** * @category model * @since 2.5.0 */ export declare type ReadonlyNonEmptyArray = ReadonlyArray & { readonly 0: A } /** * Remove duplicates from a `ReadonlyNonEmptyArray`, keeping the first occurrence of an element. * * @example * import { uniq } from 'fp-ts/ReadonlyNonEmptyArray' * import * as N from 'fp-ts/number' * * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2]) * * @since 2.11.0 */ export declare const uniq: (E: Eq) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Sort the elements of a `ReadonlyNonEmptyArray` in increasing order, where elements are compared using first `ords[0]`, then `ords[1]`, * etc... * * @example * import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray' * import { contramap } from 'fp-ts/Ord' * import * as S from 'fp-ts/string' * import * as N from 'fp-ts/number' * import { pipe } from 'fp-ts/function' * * interface Person { * name: string * age: number * } * * const byName = pipe(S.Ord, contramap((p: Person) => p.name)) * * const byAge = pipe(N.Ord, contramap((p: Person) => p.age)) * * const sortByNameByAge = RNEA.sortBy([byName, byAge]) * * const persons: RNEA.ReadonlyNonEmptyArray = [ * { name: 'a', age: 1 }, * { name: 'b', age: 3 }, * { name: 'c', age: 2 }, * { name: 'b', age: 2 } * ] * * assert.deepStrictEqual(sortByNameByAge(persons), [ * { name: 'a', age: 1 }, * { name: 'b', age: 2 }, * { name: 'b', age: 3 }, * { name: 'c', age: 2 } * ]) * * @since 2.11.0 */ export declare const sortBy: ( ords: readonly Ord[] ) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @since 2.11.0 */ export declare const union: ( E: Eq ) => (second: ReadonlyNonEmptyArray) => (first: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Rotate a `ReadonlyNonEmptyArray` by `n` steps. * * @example * import { rotate } from 'fp-ts/ReadonlyNonEmptyArray' * * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3]) * assert.deepStrictEqual(rotate(-2)([1, 2, 3, 4, 5]), [3, 4, 5, 1, 2]) * * @since 2.11.0 */ export declare const rotate: (n: number) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Return a `ReadonlyNonEmptyArray` from a `ReadonlyArray` returning `none` if the input is empty. * * @category conversions * @since 2.5.0 */ export declare const fromReadonlyArray: (as: readonly A[]) => Option> /** * Return a `ReadonlyNonEmptyArray` of length `n` with element `i` initialized with `f(i)`. * * **Note**. `n` is normalized to a natural number. * * @example * import { makeBy } from 'fp-ts/ReadonlyNonEmptyArray' * import { pipe } from 'fp-ts/function' * * const double = (n: number): number => n * 2 * assert.deepStrictEqual(pipe(5, makeBy(double)), [0, 2, 4, 6, 8]) * * @category constructors * @since 2.11.0 */ export declare const makeBy: (f: (i: number) => A) => (n: number) => ReadonlyNonEmptyArray /** * Create a `ReadonlyNonEmptyArray` containing a value repeated the specified number of times. * * **Note**. `n` is normalized to a natural number. * * @example * import { replicate } from 'fp-ts/ReadonlyNonEmptyArray' * import { pipe } from 'fp-ts/function' * * assert.deepStrictEqual(pipe(3, replicate('a')), ['a', 'a', 'a']) * * @category constructors * @since 2.11.0 */ export declare const replicate: (a: A) => (n: number) => ReadonlyNonEmptyArray /** * Create a `ReadonlyNonEmptyArray` containing a range of integers, including both endpoints. * * @example * import { range } from 'fp-ts/ReadonlyNonEmptyArray' * * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5]) * * @category constructors * @since 2.11.0 */ export declare const range: (start: number, end: number) => ReadonlyNonEmptyArray /** * Return the tuple of the `head` and the `tail`. * * @example * import { unprepend } from 'fp-ts/ReadonlyNonEmptyArray' * * assert.deepStrictEqual(unprepend([1, 2, 3, 4]), [1, [2, 3, 4]]) * * @since 2.9.0 */ export declare const unprepend: (as: ReadonlyNonEmptyArray) => readonly [A, readonly A[]] /** * Return the tuple of the `init` and the `last`. * * @example * import { unappend } from 'fp-ts/ReadonlyNonEmptyArray' * * assert.deepStrictEqual(unappend([1, 2, 3, 4]), [[1, 2, 3], 4]) * * @since 2.9.0 */ export declare const unappend: (as: ReadonlyNonEmptyArray) => readonly [readonly A[], A] /** * @category conversions * @since 2.5.0 */ export declare const fromArray: (as: A[]) => Option> /** * @since 2.11.0 */ export declare function concatW( second: ReadonlyNonEmptyArray ): (first: ReadonlyArray) => ReadonlyNonEmptyArray export declare function concatW( second: ReadonlyArray ): (first: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @since 2.5.0 */ export declare function concat( second: ReadonlyNonEmptyArray ): (first: ReadonlyArray) => ReadonlyNonEmptyArray export declare function concat( second: ReadonlyArray ): (first: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** @deprecated */ export declare function concat(first: ReadonlyArray, second: ReadonlyNonEmptyArray): ReadonlyNonEmptyArray /** @deprecated */ export declare function concat(first: ReadonlyNonEmptyArray, second: ReadonlyArray): ReadonlyNonEmptyArray /** * @since 2.5.0 */ export declare const reverse: (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Group equal, consecutive elements of a `ReadonlyArray` into `ReadonlyNonEmptyArray`s. * * @example * import { group } from 'fp-ts/ReadonlyNonEmptyArray' * import * as N from 'fp-ts/number' * * assert.deepStrictEqual(group(N.Eq)([1, 2, 1, 1]), [ * [1], * [2], * [1, 1] * ]) * * @since 2.5.0 */ export declare function group(E: Eq): { (as: ReadonlyNonEmptyArray): ReadonlyNonEmptyArray> (as: ReadonlyArray): ReadonlyArray> } /** * 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 * * @example * import { groupBy } from 'fp-ts/ReadonlyNonEmptyArray' * * assert.deepStrictEqual(groupBy((s: string) => String(s.length))(['a', 'b', 'ab']), { * '1': ['a', 'b'], * '2': ['ab'] * }) * * @since 2.5.0 */ export declare const groupBy: ( f: (a: A) => string ) => (as: readonly A[]) => Readonly>> /** * @since 2.5.0 */ export declare const sort: (O: Ord) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @since 2.5.0 */ export declare const updateAt: ( i: number, a: A ) => (as: ReadonlyNonEmptyArray) => Option> /** * @since 2.5.0 */ export declare const modifyAt: ( i: number, f: (a: A) => A ) => (as: ReadonlyNonEmptyArray) => Option> /** * @since 2.5.1 */ export declare const zipWith: ( as: ReadonlyNonEmptyArray, bs: ReadonlyNonEmptyArray, f: (a: A, b: B) => C ) => ReadonlyNonEmptyArray /** * @since 2.5.1 */ export declare function zip( bs: ReadonlyNonEmptyArray ): (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray export declare function zip( as: ReadonlyNonEmptyArray, bs: ReadonlyNonEmptyArray ): ReadonlyNonEmptyArray /** * @since 2.5.1 */ export declare const unzip: ( abs: ReadonlyNonEmptyArray ) => readonly [ReadonlyNonEmptyArray, ReadonlyNonEmptyArray] /** * Prepend an element to every member of a `ReadonlyNonEmptyArray`. * * @example * import { prependAll } from 'fp-ts/ReadonlyNonEmptyArray' * * assert.deepStrictEqual(prependAll(9)([1, 2, 3, 4]), [9, 1, 9, 2, 9, 3, 9, 4]) * * @since 2.10.0 */ export declare const prependAll: (middle: A) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Places an element in between members of a `ReadonlyNonEmptyArray`. * * @example * import { intersperse } from 'fp-ts/ReadonlyNonEmptyArray' * * assert.deepStrictEqual(intersperse(9)([1, 2, 3, 4]), [1, 9, 2, 9, 3, 9, 4]) * * @since 2.9.0 */ export declare const intersperse: (middle: A) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @category sequencing * @since 2.10.0 */ export declare const chainWithIndex: ( f: (i: number, a: A) => ReadonlyNonEmptyArray ) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * A useful recursion pattern for processing a `ReadonlyNonEmptyArray` to produce a new `ReadonlyNonEmptyArray`, often used for "chopping" up the input * `ReadonlyNonEmptyArray`. Typically `chop` is called with some function that will consume an initial prefix of the `ReadonlyNonEmptyArray` and produce a * value and the tail of the `ReadonlyNonEmptyArray`. * * @since 2.10.0 */ export declare const chop: ( f: (as: ReadonlyNonEmptyArray) => readonly [B, readonly A[]] ) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Splits a `ReadonlyNonEmptyArray` into two pieces, the first piece has max `n` elements. * * @since 2.10.0 */ export declare const splitAt: ( n: number ) => (as: ReadonlyNonEmptyArray) => readonly [ReadonlyNonEmptyArray, readonly A[]] /** * Splits a `ReadonlyNonEmptyArray` into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of * the `ReadonlyNonEmptyArray`. * * @since 2.10.0 */ export declare const chunksOf: ( n: number ) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray> /** * @category constructors * @since 2.5.0 */ export declare const of: (a: A) => ReadonlyNonEmptyArray /** * Less strict version of [`alt`](#alt). * * The `W` suffix (short for **W**idening) means that the return types will be merged. * * @example * import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray' * import { pipe } from 'fp-ts/function' * * assert.deepStrictEqual( * pipe( * [1, 2, 3] as RNEA.ReadonlyNonEmptyArray, * RNEA.altW(() => ['a', 'b']) * ), * [1, 2, 3, 'a', 'b'] * ) * * @category error handling * @since 2.9.0 */ export declare const altW: ( that: Lazy> ) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to * types of kind `* -> *`. * * In case of `ReadonlyNonEmptyArray` concatenates the inputs into a single array. * * @example * import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray' * import { pipe } from 'fp-ts/function' * * assert.deepStrictEqual( * pipe( * [1, 2, 3], * RNEA.alt(() => [4, 5]) * ), * [1, 2, 3, 4, 5] * ) * * @category error handling * @since 2.6.2 */ export declare const alt: ( that: Lazy> ) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @since 2.5.0 */ export declare const ap: ( as: ReadonlyNonEmptyArray ) => (fab: ReadonlyNonEmptyArray<(a: A) => B>) => ReadonlyNonEmptyArray /** * Composes computations in sequence, using the return value of one computation to determine the next computation. * * @example * import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray' * import { pipe } from 'fp-ts/function' * * assert.deepStrictEqual( * pipe( * [1, 2, 3], * RNEA.chain((n) => [`a${n}`, `b${n}`]) * ), * ['a1', 'b1', 'a2', 'b2', 'a3', 'b3'] * ) * * @category sequencing * @since 2.5.0 */ export declare const chain: ( f: (a: A) => ReadonlyNonEmptyArray ) => (ma: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @since 2.5.0 */ export declare const extend: ( f: (as: ReadonlyNonEmptyArray) => B ) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @since 2.5.0 */ export declare const duplicate: (ma: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray> /** * @category sequencing * @since 2.5.0 */ export declare const flatten: (mma: ReadonlyNonEmptyArray>) => ReadonlyNonEmptyArray /** * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types * use the type constructor `F` to represent some computational context. * * @category mapping * @since 2.5.0 */ export declare const map: (f: (a: A) => B) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @category mapping * @since 2.5.0 */ export declare const mapWithIndex: ( f: (i: number, a: A) => B ) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @category folding * @since 2.5.0 */ export declare const reduce: (b: B, f: (b: B, a: A) => B) => (as: ReadonlyNonEmptyArray) => B /** * **Note**. The constraint is relaxed: a `Semigroup` instead of a `Monoid`. * * @category folding * @since 2.5.0 */ export declare const foldMap: (S: Se.Semigroup) => (f: (a: A) => S) => (as: ReadonlyNonEmptyArray) => S /** * @category folding * @since 2.5.0 */ export declare const reduceRight: (b: B, f: (a: A, b: B) => B) => (as: ReadonlyNonEmptyArray) => B /** * @category folding * @since 2.5.0 */ export declare const reduceWithIndex: ( b: B, f: (i: number, b: B, a: A) => B ) => (as: ReadonlyNonEmptyArray) => B /** * **Note**. The constraint is relaxed: a `Semigroup` instead of a `Monoid`. * * @category folding * @since 2.5.0 */ export declare const foldMapWithIndex: ( S: Se.Semigroup ) => (f: (i: number, a: A) => S) => (as: ReadonlyNonEmptyArray) => S /** * @category folding * @since 2.5.0 */ export declare const reduceRightWithIndex: ( b: B, f: (i: number, a: A, b: B) => B ) => (as: ReadonlyNonEmptyArray) => B /** * @category traversing * @since 2.6.3 */ export declare const traverse: PipeableTraverse1 /** * @category traversing * @since 2.6.3 */ export declare const sequence: Traversable1['sequence'] /** * @category sequencing * @since 2.6.3 */ export declare const traverseWithIndex: PipeableTraverseWithIndex1 /** * @category Comonad * @since 2.6.3 */ export declare const extract: Comonad1['extract'] /** * @category type lambdas * @since 2.5.0 */ export declare const URI = 'ReadonlyNonEmptyArray' /** * @category type lambdas * @since 2.5.0 */ export declare type URI = typeof URI declare module './HKT' { interface URItoKind { readonly [URI]: ReadonlyNonEmptyArray } } /** * @category instances * @since 2.5.0 */ export declare const getShow: (S: Show) => Show> /** * Builds a `Semigroup` instance for `ReadonlyNonEmptyArray` * * @category instances * @since 2.5.0 */ export declare const getSemigroup: () => Se.Semigroup> /** * @example * import { getEq } from 'fp-ts/ReadonlyNonEmptyArray' * import * as N from 'fp-ts/number' * * const E = getEq(N.Eq) * assert.strictEqual(E.equals([1, 2], [1, 2]), true) * assert.strictEqual(E.equals([1, 2], [1, 3]), false) * * @category instances * @since 2.5.0 */ export declare const getEq: (E: Eq) => Eq> /** * @since 2.11.0 */ export declare const getUnionSemigroup: (E: Eq) => Se.Semigroup> /** * @category instances * @since 2.7.0 */ export declare const Functor: Functor1 /** * @category mapping * @since 2.10.0 */ export declare const flap: (a: A) => (fab: ReadonlyNonEmptyArray<(a: A) => B>) => ReadonlyNonEmptyArray /** * @category instances * @since 2.10.0 */ export declare const Pointed: Pointed1 /** * @category instances * @since 2.7.0 */ export declare const FunctorWithIndex: FunctorWithIndex1 /** * @category instances * @since 2.10.0 */ export declare const Apply: Apply1 /** * Combine two effectful actions, keeping only the result of the first. * * @since 2.5.0 */ export declare const apFirst: ( second: ReadonlyNonEmptyArray ) => (first: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Combine two effectful actions, keeping only the result of the second. * * @since 2.5.0 */ export declare const apSecond: ( second: ReadonlyNonEmptyArray ) => (first: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @category instances * @since 2.7.0 */ export declare const Applicative: Applicative1 /** * @category instances * @since 2.10.0 */ export declare const Chain: Chain1 /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. * * @example * import * as RA from 'fp-ts/ReadonlyArray' * import { pipe } from 'fp-ts/function' * * assert.deepStrictEqual( * pipe( * [1, 2, 3], * RA.chainFirst(() => ['a', 'b']) * ), * [1, 1, 2, 2, 3, 3] * ) * * @category sequencing * @since 2.5.0 */ export declare const chainFirst: ( f: (a: A) => ReadonlyNonEmptyArray ) => (first: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * @category instances * @since 2.7.0 */ export declare const Monad: Monad1 /** * @category instances * @since 2.7.0 */ export declare const Foldable: Foldable1 /** * @category instances * @since 2.7.0 */ export declare const FoldableWithIndex: FoldableWithIndex1 /** * @category instances * @since 2.7.0 */ export declare const Traversable: Traversable1 /** * @category instances * @since 2.7.0 */ export declare const TraversableWithIndex: TraversableWithIndex1 /** * @category instances * @since 2.7.0 */ export declare const Alt: Alt1 /** * @category instances * @since 2.7.0 */ export declare const Comonad: Comonad1 /** * @category do notation * @since 2.9.0 */ export declare const Do: ReadonlyNonEmptyArray<{}> /** * @category do notation * @since 2.8.0 */ export declare const bindTo: ( name: N ) => (fa: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray<{ readonly [K in N]: A }> declare const let_: ( name: Exclude, f: (a: A) => B ) => ( fa: ReadonlyNonEmptyArray ) => ReadonlyNonEmptyArray<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }> export { /** * @category do notation * @since 2.13.0 */ let_ as let } /** * @category do notation * @since 2.8.0 */ export declare const bind: ( name: Exclude, f: (a: A) => ReadonlyNonEmptyArray ) => ( ma: ReadonlyNonEmptyArray ) => ReadonlyNonEmptyArray<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }> /** * @category do notation * @since 2.8.0 */ export declare const apS: ( name: Exclude, fb: ReadonlyNonEmptyArray ) => ( fa: ReadonlyNonEmptyArray ) => ReadonlyNonEmptyArray<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }> /** * @since 2.5.0 */ export declare const head: (as: ReadonlyNonEmptyArray) => A /** * @since 2.5.0 */ export declare const tail: (as: ReadonlyNonEmptyArray) => ReadonlyArray /** * @since 2.5.0 */ export declare const last: (as: ReadonlyNonEmptyArray) => A /** * Get all but the last element of a non empty array, creating a new array. * * @example * import { init } from 'fp-ts/ReadonlyNonEmptyArray' * * assert.deepStrictEqual(init([1, 2, 3]), [1, 2]) * assert.deepStrictEqual(init([1]), []) * * @since 2.5.0 */ export declare const init: (as: ReadonlyNonEmptyArray) => readonly A[] /** * @since 2.5.0 */ export declare const min: (O: Ord) => (as: ReadonlyNonEmptyArray) => A /** * @since 2.5.0 */ export declare const max: (O: Ord) => (as: ReadonlyNonEmptyArray) => A /** * @since 2.10.0 */ export declare const concatAll: (S: Se.Semigroup) => (as: ReadonlyNonEmptyArray) => A /** * Break a `ReadonlyArray` into its first element and remaining elements. * * @category pattern matching * @since 2.11.0 */ export declare const matchLeft: (f: (head: A, tail: readonly A[]) => B) => (as: ReadonlyNonEmptyArray) => B /** * Break a `ReadonlyArray` into its initial elements and the last element. * * @category pattern matching * @since 2.11.0 */ export declare const matchRight: (f: (init: readonly A[], last: A) => B) => (as: ReadonlyNonEmptyArray) => B /** * Apply a function to the head, creating a new `ReadonlyNonEmptyArray`. * * @since 2.11.0 */ export declare const modifyHead: (f: Endomorphism) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Change the head, creating a new `ReadonlyNonEmptyArray`. * * @since 2.11.0 */ export declare const updateHead: (a: A) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Apply a function to the last element, creating a new `ReadonlyNonEmptyArray`. * * @since 2.11.0 */ export declare const modifyLast: (f: Endomorphism) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Change the last element, creating a new `ReadonlyNonEmptyArray`. * * @since 2.11.0 */ export declare const updateLast: (a: A) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Places an element in between members of a `ReadonlyNonEmptyArray`, then folds the results using the provided `Semigroup`. * * @example * import * as S from 'fp-ts/string' * import { intercalate } from 'fp-ts/ReadonlyNonEmptyArray' * * assert.deepStrictEqual(intercalate(S.Semigroup)('-')(['a', 'b', 'c']), 'a-b-c') * * @since 2.12.0 */ export declare const intercalate: (S: Se.Semigroup) => (middle: A) => (as: ReadonlyNonEmptyArray) => A /** * This is just `sort` followed by `group`. * * @category zone of death * @since 2.5.0 * @deprecated */ export declare function groupSort(O: Ord): { (as: ReadonlyNonEmptyArray): ReadonlyNonEmptyArray> (as: ReadonlyArray): ReadonlyArray> } /** * Use [`filter`](./ReadonlyArray.ts.html#filter) instead. * * @category zone of death * @since 2.5.0 * @deprecated */ export declare function filter( refinement: Refinement ): (as: ReadonlyNonEmptyArray) => Option> export declare function filter( predicate: Predicate ): (bs: ReadonlyNonEmptyArray) => Option> export declare function filter( predicate: Predicate ): (as: ReadonlyNonEmptyArray) => Option> /** * Use [`filterWithIndex`](./ReadonlyArray.ts.html#filterwithindex) instead. * * @category zone of death * @since 2.5.0 * @deprecated */ export declare const filterWithIndex: ( predicate: (i: number, a: A) => boolean ) => (as: ReadonlyNonEmptyArray) => Option> /** * Use [`unprepend`](#unprepend) instead. * * @category zone of death * @since 2.10.0 * @deprecated */ export declare const uncons: (as: ReadonlyNonEmptyArray) => readonly [A, ReadonlyArray] /** * Use [`unappend`](#unappend) instead. * * @category zone of death * @since 2.10.0 * @deprecated */ export declare const unsnoc: (as: ReadonlyNonEmptyArray) => readonly [ReadonlyArray, A] /** * Use [`prepend`](./ReadonlyArray.ts.html#prepend) instead. * * @category zone of death * @since 2.5.0 * @deprecated */ export declare function cons(head: A): (tail: ReadonlyArray) => ReadonlyNonEmptyArray /** @deprecated */ export declare function cons(head: A, tail: ReadonlyArray): ReadonlyNonEmptyArray /** * Use [`append`](./ReadonlyArray.ts.html#append) instead. * * @category zone of death * @since 2.5.0 * @deprecated */ export declare const snoc: (init: readonly A[], end: A) => ReadonlyNonEmptyArray /** * Use [`insertAt`](./ReadonlyArray.ts.html#insertat) instead. * * @category zone of death * @since 2.5.0 * @deprecated */ export declare const insertAt: (i: number, a: A) => (as: readonly A[]) => Option> /** * Use [`prependAll`](#prependall) instead. * * @category zone of death * @since 2.9.0 * @deprecated */ export declare const prependToAll: (middle: A) => (as: ReadonlyNonEmptyArray) => ReadonlyNonEmptyArray /** * Use [`concatAll`](#concatall) instead. * * @category zone of death * @since 2.5.0 * @deprecated */ export declare const fold: (S: Se.Semigroup) => (as: ReadonlyNonEmptyArray) => A /** * This instance is deprecated, use small, specific instances instead. * For example if a function needs a `Functor` instance, pass `RNEA.Functor` instead of `RNEA.readonlyNonEmptyArray` * (where `RNEA` is from `import RNEA from 'fp-ts/ReadonlyNonEmptyArray'`) * * @category zone of death * @since 2.5.0 * @deprecated */ export declare const readonlyNonEmptyArray: Monad1 & Comonad1 & TraversableWithIndex1 & FunctorWithIndex1 & FoldableWithIndex1 & Alt1