Variables
Const ap
ap
: { <A, B>
(fn
: ReadonlyArray<Arity1<A, B>>, value
: ReadonlyArray<A>): B[]; <A, B>
(fn
: ReadonlyArray<Arity1<A, B>>): (value
: ReadonlyArray<A>) => B[] } = curry(<A, B>(fn: ReadonlyArray<Arity1<A, B>>, value: ReadonlyArray<A>): B[] =>chain((f) => map(f, value), fn),) as {<A, B>(fn: ReadonlyArray<Arity1<A, B>>, value: ReadonlyArray<A>): B[]<A, B>(fn: ReadonlyArray<Arity1<A, B>>): (value: ReadonlyArray<A>) => B[]}
Type declaration
-
- <A, B>(fn: ReadonlyArray<Arity1<A, B>>, value: ReadonlyArray<A>): B[]
- <A, B>(fn: ReadonlyArray<Arity1<A, B>>): (value: ReadonlyArray<A>) => B[]
-
Type parameters
Parameters
-
fn: ReadonlyArray<Arity1<A, B>>
-
value: ReadonlyArray<A>
Returns B[]
-
Type parameters
Parameters
-
fn: ReadonlyArray<Arity1<A, B>>
Returns (value: ReadonlyArray<A>) => B[]
-
- (value: ReadonlyArray<A>): B[]
Const append
append: { <A>(value: A, list: ReadonlyArray<A>): A[]; <A>(value: A): (list: ReadonlyArray<A>) => A[] } = curry(_append) as {<A>(value: A, list: ReadonlyArray<A>): A[]<A>(value: A): (list: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A>(value: A, list: ReadonlyArray<A>): A[]
- <A>(value: A): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
value: A
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const appendOrRemove
appendOrRemove: { <A>(item: A, items: ReadonlyArray<A>): A[]; <A>(item: A): (items: ReadonlyArray<A>) => A[] } = curry(<A>(item: A, items: ReadonlyArray<A>): A[] =>__appendOrRemove(item, items, id),) as {<A>(item: A, items: ReadonlyArray<A>): A[]<A>(item: A): (items: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A>(item: A, items: ReadonlyArray<A>): A[]
- <A>(item: A): (items: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
item: A
-
items: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (items: ReadonlyArray<A>) => A[]
-
- (items: ReadonlyArray<A>): A[]
Const appendOrRemoveBy
appendOrRemoveBy: { <A, B>(item: A, items: ReadonlyArray<A>, comparison: (value: A) => B): A[]; <A>(item: A, items: ReadonlyArray<A>): <B>(comparison: (value: A) => B) => A[]; <A>(item: A): { <B>(items: ReadonlyArray<A>, comparison: (value: A) => B): A[]; (items: ReadonlyArray<A>): <B>(comparison: (value: A) => B) => A[] } } = curry(__appendOrRemove) as {<A, B = A>(item: A, items: ReadonlyArray<A>, comparison: (value: A) => B): A[]<A>(item: A, items: ReadonlyArray<A>): <B = A>(comparison: (value: A) => B) => A[]<A>(item: A): {<B = A>(items: ReadonlyArray<A>, comparison: (value: A) => B): A[](items: ReadonlyArray<A>): <B = A>(comparison: (value: A) => B) => A[]}}
Type declaration
-
- <A, B>(item: A, items: ReadonlyArray<A>, comparison: (value: A) => B): A[]
- <A>(item: A, items: ReadonlyArray<A>): <B>(comparison: (value: A) => B) => A[]
- <A>(item: A): { <B>(items: ReadonlyArray<A>, comparison: (value: A) => B): A[]; (items: ReadonlyArray<A>): <B>(comparison: (value: A) => B) => A[] }
-
Type parameters
Parameters
-
item: A
-
items: ReadonlyArray<A>
-
comparison: (value: A) => B
Returns A[]
-
Type parameters
Parameters
-
item: A
-
items: ReadonlyArray<A>
Returns <B>(comparison: (value: A) => B) => A[]
-
- <B>(comparison: (value: A) => B): A[]
-
Type parameters
Parameters
-
comparison: (value: A) => B
Returns A[]
-
Type parameters
Parameters
Returns { <B>(items: ReadonlyArray<A>, comparison: (value: A) => B): A[]; (items: ReadonlyArray<A>): <B>(comparison: (value: A) => B) => A[] }
-
- <B>(items: ReadonlyArray<A>, comparison: (value: A) => B): A[]
- (items: ReadonlyArray<A>): <B>(comparison: (value: A) => B) => A[]
-
Type parameters
Parameters
-
items: ReadonlyArray<A>
-
comparison: (value: A) => B
Returns A[]
-
Parameters
Returns <B>(comparison: (value: A) => B) => A[]
-
- <B>(comparison: (value: A) => B): A[]
-
Type parameters
Parameters
-
comparison: (value: A) => B
Returns A[]
Const ascend
ascend
: { <A, B>
(f
: (a
: A) => B, a
: A, b
: A): ComparisonNumbers; <A, B>
(f
: (a
: A) => B, a
: A): (b
: A) => ComparisonNumbers; <A, B>
(f
: (a
: A) => B): { (a
: A, b
: A): ComparisonNumbers; (a
: A): (b
: A) => ComparisonNumbers } } = curry(function ascend<A, B extends ComparableValues>(f: (a: A) => B,a: A,b: A,): ComparisonNumbers {const aa = f(a)const bb = f(b)if (aa < bb) {return -1}if (aa > bb) {return 1}return 0}) as {<A, B extends ComparableValues>(f: (a: A) => B, a: A, b: A): ComparisonNumbers<A, B extends ComparableValues>(f: (a: A) => B, a: A): (b: A) => ComparisonNumbers<A, B extends ComparableValues>(f: (a: A) => B): {(a: A, b: A): ComparisonNumbers(a: A): (b: A) => ComparisonNumbers}}
Type declaration
-
-
Type parameters
Parameters
-
Type parameters
Parameters
-
Type parameters
Parameters
Const chain
chain
: { <A, B>
(fn
: Arity2<A, number, ReadonlyArray<B>>, list
: ReadonlyArray<A>): B[]; <A, B>
(fn
: Arity2<A, number, ReadonlyArray<B>>): (list
: ReadonlyArray<A>) => B[] } = curry((f, list) => unnest(list.map(f))) as {<A, B>(fn: Arity2<A, number, ReadonlyArray<B>>, list: ReadonlyArray<A>): B[]<A, B>(fn: Arity2<A, number, ReadonlyArray<B>>): (list: ReadonlyArray<A>) => B[]}
Type declaration
-
- <A, B>(fn: Arity2<A, number, ReadonlyArray<B>>, list: ReadonlyArray<A>): B[]
- <A, B>(fn: Arity2<A, number, ReadonlyArray<B>>): (list: ReadonlyArray<A>) => B[]
-
Type parameters
Parameters
-
fn: Arity2<A, number, ReadonlyArray<B>>
-
list: ReadonlyArray<A>
Returns B[]
-
Type parameters
Parameters
-
fn: Arity2<A, number, ReadonlyArray<B>>
Returns (list: ReadonlyArray<A>) => B[]
-
- (list: ReadonlyArray<A>): B[]
Const concat
concat: { <A>(head: ReadonlyArray<A>, tail: ReadonlyArray<A>): A[]; <A>(head: ReadonlyArray<A>): (tail: ReadonlyArray<A>) => A[] } = curry((a, b) => a.concat(b)) as {<A>(head: ReadonlyArray<A>, tail: ReadonlyArray<A>): A[]<A>(head: ReadonlyArray<A>): (tail: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A>(head: ReadonlyArray<A>, tail: ReadonlyArray<A>): A[]
- <A>(head: ReadonlyArray<A>): (tail: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
head: ReadonlyArray<A>
-
tail: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (tail: ReadonlyArray<A>) => A[]
-
- (tail: ReadonlyArray<A>): A[]
Const contains
contains: { <A>(value: A, list: ArrayLike<A>): boolean; <A>(value: A): (list: ArrayLike<A>) => boolean } = curry((value, list) => isJust(indexOf(value, list))) as {<A>(value: A, list: ArrayLike<A>): boolean<A>(value: A): (list: ArrayLike<A>) => boolean}
Type declaration
-
- <A>(value: A, list: ArrayLike<A>): boolean
- <A>(value: A): (list: ArrayLike<A>) => boolean
-
Type parameters
Parameters
-
value: A
-
list: ArrayLike<A>
Returns boolean
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => boolean
-
- (list: ArrayLike<A>): boolean
-
Parameters
Returns boolean
Const descend
descend
: { <A, B>
(f
: (a
: A) => B, a
: A, b
: A): ComparisonNumbers; <A, B>
(f
: (a
: A) => B, a
: A): (b
: A) => ComparisonNumbers; <A, B>
(f
: (a
: A) => B): { (a
: A, b
: A): ComparisonNumbers; (a
: A): (b
: A) => ComparisonNumbers } } = curry(function descend<A, B extends ComparableValues>(f: (a: A) => B,a: A,b: A,): ComparisonNumbers {const aa = f(a)const bb = f(b)if (aa < bb) {return 1}if (aa > bb) {return -1}return 0}) as {<A, B extends ComparableValues>(f: (a: A) => B, a: A, b: A): ComparisonNumbers<A, B extends ComparableValues>(f: (a: A) => B, a: A): (b: A) => ComparisonNumbers<A, B extends ComparableValues>(f: (a: A) => B): {(a: A, b: A): ComparisonNumbers(a: A): (b: A) => ComparisonNumbers}}
Type declaration
-
-
Type parameters
Parameters
-
Type parameters
Parameters
-
Type parameters
Parameters
Const drop
drop: { <A>(quantity: number, list: ReadonlyArray<A>): A[]; <A>(quantity: number): (list: ReadonlyArray<A>) => A[] } = curry(<A>(quantity: number, list: ReadonlyArray<A>): A[] =>list.slice(quantity),) as {<A>(quantity: number, list: ReadonlyArray<A>): A[]<A>(quantity: number): (list: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A>(quantity: number, list: ReadonlyArray<A>): A[]
- <A>(quantity: number): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
quantity: number
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const dropLast
dropLast: { <A>(quantity: number, list: ReadonlyArray<A>): A[]; <A>(quantity: number): (list: ReadonlyArray<A>) => A[] } = curry(<A>(quantity: number, list: ReadonlyArray<A>): A[] =>list.slice(0, list.length - quantity),) as {<A>(quantity: number, list: ReadonlyArray<A>): A[]<A>(quantity: number): (list: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A>(quantity: number, list: ReadonlyArray<A>): A[]
- <A>(quantity: number): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
quantity: number
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const endsWith
endsWith: { <A>(expected: ReadonlyArray<A>, list: ArrayLike<A>): boolean; <A>(expected: ReadonlyArray<A>): (list: ArrayLike<A>) => boolean } = curry(<A>(expected: ReadonlyArray<A>, list: ArrayLike<A>) =>equals(expected, slice(list.length - expected.length, list.length, list)),) as {<A>(expected: ReadonlyArray<A>, list: ArrayLike<A>): boolean<A>(expected: ReadonlyArray<A>): (list: ArrayLike<A>) => boolean}
Type declaration
-
- <A>(expected: ReadonlyArray<A>, list: ArrayLike<A>): boolean
- <A>(expected: ReadonlyArray<A>): (list: ArrayLike<A>) => boolean
-
Type parameters
Parameters
-
expected: ReadonlyArray<A>
-
list: ArrayLike<A>
Returns boolean
-
Type parameters
Parameters
-
expected: ReadonlyArray<A>
Returns (list: ArrayLike<A>) => boolean
-
- (list: ArrayLike<A>): boolean
-
Parameters
Returns boolean
Const filter
filter
: { <A, B>
(predicate
: Is<B>, list
: ReadonlyArray<A>): B[]; <B>
(predicate
: Is<B>): <A>
(list
: ReadonlyArray<A>) => B[]; <A>
(predicate
: Predicate<A>, list
: ReadonlyArray<A>): A[]; <A>
(predicate
: Predicate<A>): (list
: ReadonlyArray<A>) => A[] } = curry(<A>(predicate: Predicate<A>, list: ReadonlyArray<A>): A[] => list.filter(predicate)) as {<A, B extends A>(predicate: Is<B>, list: ReadonlyArray<A>): B[]<B>(predicate: Is<B>): <A>(list: ReadonlyArray<A>) => B[]<A>(predicate: Predicate<A>, list: ReadonlyArray<A>): A[]<A>(predicate: Predicate<A>): (list: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A, B>(predicate: Is<B>, list: ReadonlyArray<A>): B[]
- <B>(predicate: Is<B>): <A>(list: ReadonlyArray<A>) => B[]
- <A>(predicate: Predicate<A>, list: ReadonlyArray<A>): A[]
- <A>(predicate: Predicate<A>): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
predicate: Is<B>
-
list: ReadonlyArray<A>
Returns B[]
-
Type parameters
Parameters
Returns <A>(list: ReadonlyArray<A>) => B[]
-
- <A>(list: ReadonlyArray<A>): B[]
-
Type parameters
Parameters
Returns B[]
-
Type parameters
Parameters
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const find
find
: { <A>
(predicate
: Predicate<NoInfer<A>>, list
: ArrayLike<A>): Maybe<A>; <A>
(predicate
: Predicate<A>): (list
: ArrayLike<A>) => Maybe<A> } = curry(<A>(predicate: Predicate<NoInfer<A>>, list: ArrayLike<A>): Maybe<A> =>map((index: number) => list[index], findIndex(predicate, list)),) as {<A>(predicate: Predicate<NoInfer<A>>, list: ArrayLike<A>): Maybe<A><A>(predicate: Predicate<A>): (list: ArrayLike<A>) => Maybe<A>}
Type declaration
-
-
Type parameters
Parameters
Returns Maybe<A>
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => Maybe<A>
-
- (list: ArrayLike<A>): Maybe<A>
-
Parameters
Returns Maybe<A>
Const findIndex
find
Index: { <A>(predicate: Predicate<NoInfer<A>>, list: ArrayLike<A>): Maybe<number>; <A>(predicate: Predicate<A>): (list: ArrayLike<A>) => Maybe<number> } = curry(<A>(predicate: Predicate<NoInfer<A>>, list: ArrayLike<A>): Maybe<number> => {for (let i = 0; i < list.length; ++i) {if (predicate(list[i])) {return Maybe.of(i)}}return Nothing},) as {<A>(predicate: Predicate<NoInfer<A>>, list: ArrayLike<A>): Maybe<number><A>(predicate: Predicate<A>): (list: ArrayLike<A>) => Maybe<number>}
Type declaration
-
-
Type parameters
Parameters
Returns Maybe<number>
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => Maybe<number>
-
- (list: ArrayLike<A>): Maybe<number>
-
Parameters
Returns Maybe<number>
Const findLast
find
Last: { <A>(predicate: Predicate<NoInfer<A>>, list: ArrayLike<A>): Maybe<A>; <A>(predicate: Predicate<A>): (list: ArrayLike<A>) => Maybe<A> } = curry(__findLast) as {<A>(predicate: Predicate<NoInfer<A>>, list: ArrayLike<A>): Maybe<A><A>(predicate: Predicate<A>): (list: ArrayLike<A>) => Maybe<A>}
Type declaration
-
-
Type parameters
Parameters
Returns Maybe<A>
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => Maybe<A>
-
- (list: ArrayLike<A>): Maybe<A>
-
Parameters
Returns Maybe<A>
Const findLastIndex
find
LastIndex: { <A>(predicate: Predicate<NoInfer<A>>, list: ArrayLike<A>): Maybe<number>; <A>(predicate: Predicate<A>): (list: ArrayLike<A>) => Maybe<number> } = curry(__findLastIndex) as {<A>(predicate: Predicate<NoInfer<A>>, list: ArrayLike<A>): Maybe<number><A>(predicate: Predicate<A>): (list: ArrayLike<A>) => Maybe<number>}
Type declaration
-
-
Type parameters
Parameters
Returns Maybe<number>
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => Maybe<number>
-
- (list: ArrayLike<A>): Maybe<number>
-
Parameters
Returns Maybe<number>
Const forEach
for
Each: { <R, A>(f: Arity2<R, number, void>, list: A): A; <R>(f: Arity2<R, number, void>): <A>(list: A) => A } = curry(__forEach) as {<R, A extends ArrayLike<R>>(f: Arity2<R, number, void>, list: A): A<R>(f: Arity2<R, number, void>): <A extends ArrayLike<R>>(list: A) => A}
Type declaration
-
- <R, A>(f: Arity2<R, number, void>, list: A): A
- <R>(f: Arity2<R, number, void>): <A>(list: A) => A
-
Type parameters
Parameters
-
f: Arity2<R, number, void>
-
list: A
Returns A
-
Type parameters
Parameters
Returns <A>(list: A) => A
-
-
Type parameters
Parameters
Returns A
Const groupBy
group
By: { <A, B>(f: Arity1<A, B>, list: ReadonlyArray<A>): Record<B, A[]>; <A, B>(f: Arity1<A, B>): (list: ReadonlyArray<A>) => Record<B, A[]> } = curry(__groupBy) as {<A, B extends PropertyKey>(f: Arity1<A, B>, list: ReadonlyArray<A>): Record<B, A[]><A, B extends PropertyKey>(f: Arity1<A, B>): (list: ReadonlyArray<A>) => Record<B, A[]>}
Type declaration
-
- <A, B>(f: Arity1<A, B>, list: ReadonlyArray<A>): Record<B, A[]>
- <A, B>(f: Arity1<A, B>): (list: ReadonlyArray<A>) => Record<B, A[]>
-
Type parameters
Parameters
Returns Record<B, A[]>
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => Record<B, A[]>
-
- (list: ReadonlyArray<A>): Record<B, A[]>
-
Parameters
Returns Record<B, A[]>
Const includes
includes: { <A>(value: A, list: ArrayLike<A>): boolean; <A>(value: A): (list: ArrayLike<A>) => boolean } = curry(<A>(value: A, list: ArrayLike<A>): boolean => indexOf(list, value) > -1,) as {<A>(value: A, list: ArrayLike<A>): boolean<A>(value: A): (list: ArrayLike<A>) => boolean}
Type declaration
-
- <A>(value: A, list: ArrayLike<A>): boolean
- <A>(value: A): (list: ArrayLike<A>) => boolean
-
Type parameters
Parameters
-
value: A
-
list: ArrayLike<A>
Returns boolean
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => boolean
-
- (list: ArrayLike<A>): boolean
-
Parameters
Returns boolean
Const indexOf
index
Of: { <A>(value: A, list: ArrayLike<A>): Maybe<number>; <A>(value: A): (list: ArrayLike<A>) => Maybe<number> } = curry(<A>(value: A, list: ArrayLike<A>): Maybe<number> => {const index = _indexOf(list, value)return index > -1 ? Maybe.of(index) : Nothing},) as {<A>(value: A, list: ArrayLike<A>): Maybe<number><A>(value: A): (list: ArrayLike<A>) => Maybe<number>}
Type declaration
-
- <A>(value: A, list: ArrayLike<A>): Maybe<number>
- <A>(value: A): (list: ArrayLike<A>) => Maybe<number>
-
Type parameters
Parameters
-
value: A
-
list: ArrayLike<A>
Returns Maybe<number>
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => Maybe<number>
-
- (list: ArrayLike<A>): Maybe<number>
-
Parameters
Returns Maybe<number>
Const insert
insert: { <A>(index: number, value: A, list: ReadonlyArray<A>): A[]; <A>(index: number, value: A): (list: ReadonlyArray<A>) => A[]; <A>(index: number): { (value: A, list: A[]): A[]; (value: A): (list: A[]) => A[] } } = curry(__insert) as {<A>(index: number, value: A, list: ReadonlyArray<A>): A[]<A>(index: number, value: A): (list: ReadonlyArray<A>) => A[]<A>(index: number): {(value: A, list: A[]): A[](value: A): (list: A[]) => A[]}}
Type declaration
-
- <A>(index: number, value: A, list: ReadonlyArray<A>): A[]
- <A>(index: number, value: A): (list: ReadonlyArray<A>) => A[]
- <A>(index: number): { (value: A, list: A[]): A[]; (value: A): (list: A[]) => A[] }
-
Type parameters
Parameters
-
index: number
-
value: A
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
-
Type parameters
Parameters
Returns { (value: A, list: A[]): A[]; (value: A): (list: A[]) => A[] }
-
- (value: A, list: A[]): A[]
- (value: A): (list: A[]) => A[]
-
Parameters
Returns A[]
-
Parameters
Returns (list: A[]) => A[]
Const join
join: { <A>(separator: string, list: ArrayLike<A>): string; <A>(separator: string): (list: ArrayLike<A>) => string } = curry(__join) as {<A>(separator: string, list: ArrayLike<A>): string<A>(separator: string): (list: ArrayLike<A>) => string}
Type declaration
-
- <A>(separator: string, list: ArrayLike<A>): string
- <A>(separator: string): (list: ArrayLike<A>) => string
-
Type parameters
Parameters
-
separator: string
-
list: ArrayLike<A>
Returns string
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => string
-
- (list: ArrayLike<A>): string
-
Parameters
Returns string
Const lastIndexOf
last
IndexOf: { <A>(value: A, list: ArrayLike<A>): Maybe<number>; <A>(value: A): (list: ArrayLike<A>) => Maybe<number> } = curry(__lastIndexOf) as {<A>(value: A, list: ArrayLike<A>): Maybe<number><A>(value: A): (list: ArrayLike<A>) => Maybe<number>}
Type declaration
-
- <A>(value: A, list: ArrayLike<A>): Maybe<number>
- <A>(value: A): (list: ArrayLike<A>) => Maybe<number>
-
Type parameters
Parameters
-
value: A
-
list: ArrayLike<A>
Returns Maybe<number>
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => Maybe<number>
-
- (list: ArrayLike<A>): Maybe<number>
-
Parameters
Returns Maybe<number>
Const map
map
: { <A, B>
(fn
: Arity1<A, B>, list
: ArrayLike<A>): B[]; <A, B>
(fn
: Arity1<A, B>): (list
: ArrayLike<A>) => B[] } = curry((f, list) => mapArrayLike(f, list)) as {<A, B>(fn: Arity1<A, B>, list: ArrayLike<A>): B[]<A, B>(fn: Arity1<A, B>): (list: ArrayLike<A>) => B[]}
Type declaration
-
- <A, B>(fn: Arity1<A, B>, list: ArrayLike<A>): B[]
- <A, B>(fn: Arity1<A, B>): (list: ArrayLike<A>) => B[]
-
Type parameters
Parameters
Returns B[]
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => B[]
-
- (list: ArrayLike<A>): B[]
Const maybeFilter
maybe
Filter: { <A, B>(predicate: Predicate2<A, B>, maybe: Maybe<A>, list: ReadonlyArray<B>): B[]; <A, B>(predicate: Predicate2<A, B>, maybe: Maybe<A>): (list: ReadonlyArray<B>) => B[]; <A, B>(predicate: Predicate2<A, B>): { (maybe: Maybe<A>, list: ReadonlyArray<B>): B[]; (maybe: Maybe<A>): (list: ReadonlyArray<B>) => B[] } } = curry(<A, B>(predicate: Predicate2<A, B>, maybe: Maybe<A>, list: ReadonlyArray<B>): B[] => {if (isNothing(maybe)) {return list.slice()}const a = fromJust(maybe)return list.filter((b) => predicate(a, b))}) as {<A, B>(predicate: Predicate2<A, B>, maybe: Maybe<A>, list: ReadonlyArray<B>): B[]<A, B>(predicate: Predicate2<A, B>, maybe: Maybe<A>): (list: ReadonlyArray<B>) => B[]<A, B>(predicate: Predicate2<A, B>): {(maybe: Maybe<A>, list: ReadonlyArray<B>): B[](maybe: Maybe<A>): (list: ReadonlyArray<B>) => B[]}}
Type declaration
-
- <A, B>(predicate: Predicate2<A, B>, maybe: Maybe<A>, list: ReadonlyArray<B>): B[]
- <A, B>(predicate: Predicate2<A, B>, maybe: Maybe<A>): (list: ReadonlyArray<B>) => B[]
- <A, B>(predicate: Predicate2<A, B>): { (maybe: Maybe<A>, list: ReadonlyArray<B>): B[]; (maybe: Maybe<A>): (list: ReadonlyArray<B>) => B[] }
-
Type parameters
Parameters
Returns B[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<B>) => B[]
-
- (list: ReadonlyArray<B>): B[]
-
Type parameters
Parameters
Returns { (maybe: Maybe<A>, list: ReadonlyArray<B>): B[]; (maybe: Maybe<A>): (list: ReadonlyArray<B>) => B[] }
-
- (maybe: Maybe<A>, list: ReadonlyArray<B>): B[]
- (maybe: Maybe<A>): (list: ReadonlyArray<B>) => B[]
-
Parameters
Returns B[]
-
Parameters
Returns (list: ReadonlyArray<B>) => B[]
-
- (list: ReadonlyArray<B>): B[]
Const move
move: { <A>(fromIndex: number, toIndex: number, list: ArrayLike<A>): A[]; (fromIndex: number, toIndex: number): <A>(list: ArrayLike<A>) => A[]; (fromIndex: number): { <A>(toIndex: number, list: ArrayLike<A>): A[]; (toIndex: number): <A>(list: ArrayLike<A>) => A[] } } = curry(__move) as {<A>(fromIndex: number, toIndex: number, list: ArrayLike<A>): A[](fromIndex: number, toIndex: number): <A>(list: ArrayLike<A>) => A[](fromIndex: number): {<A>(toIndex: number, list: ArrayLike<A>): A[](toIndex: number): <A>(list: ArrayLike<A>) => A[]}}
Type declaration
-
- <A>(fromIndex: number, toIndex: number, list: ArrayLike<A>): A[]
- (fromIndex: number, toIndex: number): <A>(list: ArrayLike<A>) => A[]
- (fromIndex: number): { <A>(toIndex: number, list: ArrayLike<A>): A[]; (toIndex: number): <A>(list: ArrayLike<A>) => A[] }
-
Type parameters
Parameters
-
fromIndex: number
-
toIndex: number
-
list: ArrayLike<A>
Returns A[]
-
Parameters
-
fromIndex: number
-
toIndex: number
Returns <A>(list: ArrayLike<A>) => A[]
-
- <A>(list: ArrayLike<A>): A[]
-
Type parameters
Parameters
Returns A[]
-
Parameters
Returns { <A>(toIndex: number, list: ArrayLike<A>): A[]; (toIndex: number): <A>(list: ArrayLike<A>) => A[] }
-
- <A>(toIndex: number, list: ArrayLike<A>): A[]
- (toIndex: number): <A>(list: ArrayLike<A>) => A[]
-
Type parameters
Parameters
-
toIndex: number
-
list: ArrayLike<A>
Returns A[]
-
Parameters
Returns <A>(list: ArrayLike<A>) => A[]
-
- <A>(list: ArrayLike<A>): A[]
-
Type parameters
Parameters
Returns A[]
Const multiSort
multi
Sort: { <A>(sortFns: Arity1<A, PropertyKey>[], list: ReadonlyArray<A>): A[]; <A>(sortFns: Arity1<A, PropertyKey>[]): (list: ReadonlyArray<A>) => A[] } = curry(function multiSort<A>(sortFns: Arity1<A, PropertyKey>[], list: ReadonlyArray<A>): A[] {return multiSortWithOrder(SortOrder.Ascending, sortFns, list)})
Type declaration
-
- <A>(sortFns: Arity1<A, PropertyKey>[], list: ReadonlyArray<A>): A[]
- <A>(sortFns: Arity1<A, PropertyKey>[]): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
sortFns: Arity1<A, PropertyKey>[]
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
-
sortFns: Arity1<A, PropertyKey>[]
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const multiSortWithOrder
multi
SortWithOrder: { <A>(order: SortOrder, sortFns: Arity1<A, PropertyKey>[], list: ReadonlyArray<A>): A[]; <A>(order: SortOrder, sortFns: Arity1<A, PropertyKey>[]): (list: ReadonlyArray<A>) => A[]; (order: SortOrder): { <A>(sortFns: Arity1<A, PropertyKey>[], list: ReadonlyArray<A>): A[]; <A>(sortFns: Arity1<A, PropertyKey>[]): (list: ReadonlyArray<A>) => A[] } } = curry(function multiSortWithOrder<A>(order: SortOrder,sortFns: Arity1<A, PropertyKey>[],list: ReadonlyArray<A>,): A[] {if (sortFns.length === 0 || list.length === 0) {return list.slice()}const sort = order === SortOrder.Ascending ? ascend : descendconst initialObject = groupBy(sortFns[0], list)const initialKeys = Object.keys(initialObject).sort(sort(id))const innerSortFns = sortFns.slice(1)const result = initialKeys.reduce((acc, key) => {acc[key] = multiSortWithOrder(order, innerSortFns, initialObject[key])return acc}, {} as Record<string, A[]>)return chain((x) => result[x], initialKeys)})
Type declaration
-
- <A>(order: SortOrder, sortFns: Arity1<A, PropertyKey>[], list: ReadonlyArray<A>): A[]
- <A>(order: SortOrder, sortFns: Arity1<A, PropertyKey>[]): (list: ReadonlyArray<A>) => A[]
- (order: SortOrder): { <A>(sortFns: Arity1<A, PropertyKey>[], list: ReadonlyArray<A>): A[]; <A>(sortFns: Arity1<A, PropertyKey>[]): (list: ReadonlyArray<A>) => A[] }
-
Type parameters
Parameters
-
-
sortFns: Arity1<A, PropertyKey>[]
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
-
-
sortFns: Arity1<A, PropertyKey>[]
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
-
Parameters
Returns { <A>(sortFns: Arity1<A, PropertyKey>[], list: ReadonlyArray<A>): A[]; <A>(sortFns: Arity1<A, PropertyKey>[]): (list: ReadonlyArray<A>) => A[] }
-
- <A>(sortFns: Arity1<A, PropertyKey>[], list: ReadonlyArray<A>): A[]
- <A>(sortFns: Arity1<A, PropertyKey>[]): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
sortFns: Arity1<A, PropertyKey>[]
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
-
sortFns: Arity1<A, PropertyKey>[]
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const prepend
prepend: { <A>(value: A, list: ReadonlyArray<A>): A[]; <A>(value: A): (list: ReadonlyArray<A>) => A[] } = curry(<A>(value: A, list: A[]): A[] => [value].concat(list)) as {<A>(value: A, list: ReadonlyArray<A>): A[]<A>(value: A): (list: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A>(value: A, list: ReadonlyArray<A>): A[]
- <A>(value: A): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
value: A
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const range
range: { (from: number, to: number): number[]; (from: number): (to: number) => number[] } = curry(__range)
Type declaration
-
- (from: number, to: number): number[]
- (from: number): (to: number) => number[]
-
Parameters
Returns number[]
-
Parameters
Returns (to: number) => number[]
-
-
Parameters
Returns number[]
Const reduce
reduce: { <A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B, list: ReadonlyArray<A>): B; <A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B): (list: ReadonlyArray<A>) => B; <A, B>(fn: (accumulator: B, value: A, index: number) => B): { (seed: B, list: ReadonlyArray<A>): B; (seed: B): (list: ReadonlyArray<A>) => B } } = curry(<A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B, list: ReadonlyArray<A>): B =>list.reduce(fn, seed),) as {<A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B, list: ReadonlyArray<A>): B<A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B): (list: ReadonlyArray<A>) => B<A, B>(fn: (accumulator: B, value: A, index: number) => B): {(seed: B, list: ReadonlyArray<A>): B(seed: B): (list: ReadonlyArray<A>) => B}}
Type declaration
-
- <A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B, list: ReadonlyArray<A>): B
- <A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B): (list: ReadonlyArray<A>) => B
- <A, B>(fn: (accumulator: B, value: A, index: number) => B): { (seed: B, list: ReadonlyArray<A>): B; (seed: B): (list: ReadonlyArray<A>) => B }
-
Type parameters
Parameters
-
fn: (accumulator: B, value: A, index: number) => B
-
- (accumulator: B, value: A, index: number): B
-
Parameters
-
accumulator: B
-
value: A
-
index: number
Returns B
-
seed: B
-
list: ReadonlyArray<A>
Returns B
-
Type parameters
Parameters
-
fn: (accumulator: B, value: A, index: number) => B
-
- (accumulator: B, value: A, index: number): B
-
Parameters
-
accumulator: B
-
value: A
-
index: number
Returns B
-
seed: B
Returns (list: ReadonlyArray<A>) => B
-
- (list: ReadonlyArray<A>): B
-
Type parameters
Parameters
-
fn: (accumulator: B, value: A, index: number) => B
-
- (accumulator: B, value: A, index: number): B
-
Parameters
-
accumulator: B
-
value: A
-
index: number
Returns B
Returns { (seed: B, list: ReadonlyArray<A>): B; (seed: B): (list: ReadonlyArray<A>) => B }
-
- (seed: B, list: ReadonlyArray<A>): B
- (seed: B): (list: ReadonlyArray<A>) => B
-
Parameters
-
seed: B
-
list: ReadonlyArray<A>
Returns B
-
Parameters
Returns (list: ReadonlyArray<A>) => B
-
- (list: ReadonlyArray<A>): B
Const reduceBy
reduce
By: ReduceByArity4 = curry(<A, B>(f: (acc: B, x: A) => B,seed: B,by: (a: A) => PropertyKey,list: A[],): { readonly [key: string]: B } => {const length = list.lengthconst newObj: any = {}for (let i = 0; i < length; ++i) {const a = list[i]const key = by(a)const b = f(newObj[key] || seed, a)newObj[key] = b}return newObj},) as ReduceByArity4
Const reduceRight
reduceRight: { <A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B, list: ReadonlyArray<A>): B; <A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B): (list: ReadonlyArray<A>) => B; <A, B>(fn: (accumulator: B, value: A, index: number) => B): { (seed: B, list: ReadonlyArray<A>): B; (seed: B): (list: ReadonlyArray<A>) => B } } = curry(<A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B, list: ReadonlyArray<A>): B =>list.reduceRight(fn, seed),) as {<A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B, list: ReadonlyArray<A>): B<A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B): (list: ReadonlyArray<A>) => B<A, B>(fn: (accumulator: B, value: A, index: number) => B): {(seed: B, list: ReadonlyArray<A>): B(seed: B): (list: ReadonlyArray<A>) => B}}
Type declaration
-
- <A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B, list: ReadonlyArray<A>): B
- <A, B>(fn: (accumulator: B, value: A, index: number) => B, seed: B): (list: ReadonlyArray<A>) => B
- <A, B>(fn: (accumulator: B, value: A, index: number) => B): { (seed: B, list: ReadonlyArray<A>): B; (seed: B): (list: ReadonlyArray<A>) => B }
-
Type parameters
Parameters
-
fn: (accumulator: B, value: A, index: number) => B
-
- (accumulator: B, value: A, index: number): B
-
Parameters
-
accumulator: B
-
value: A
-
index: number
Returns B
-
seed: B
-
list: ReadonlyArray<A>
Returns B
-
Type parameters
Parameters
-
fn: (accumulator: B, value: A, index: number) => B
-
- (accumulator: B, value: A, index: number): B
-
Parameters
-
accumulator: B
-
value: A
-
index: number
Returns B
-
seed: B
Returns (list: ReadonlyArray<A>) => B
-
- (list: ReadonlyArray<A>): B
-
Type parameters
Parameters
-
fn: (accumulator: B, value: A, index: number) => B
-
- (accumulator: B, value: A, index: number): B
-
Parameters
-
accumulator: B
-
value: A
-
index: number
Returns B
Returns { (seed: B, list: ReadonlyArray<A>): B; (seed: B): (list: ReadonlyArray<A>) => B }
-
- (seed: B, list: ReadonlyArray<A>): B
- (seed: B): (list: ReadonlyArray<A>) => B
-
Parameters
-
seed: B
-
list: ReadonlyArray<A>
Returns B
-
Parameters
Returns (list: ReadonlyArray<A>) => B
-
- (list: ReadonlyArray<A>): B
Const remove
remove: { <A>(index: number, amount: number, list: ReadonlyArray<A>): A[]; (index: number, amount: number): <A>(list: ReadonlyArray<A>) => A[]; (index: number): { <A>(amount: number, list: ReadonlyArray<A>): A[]; (amount: number): <A>(list: ReadonlyArray<A>) => A[] } } = curry(function remove<A>(index: number,amount: number,list: ReadonlyArray<A>,): A[] {const length = list.lengthif (isZero(amount) || isZero(length) || index >= length) {return list.slice()}if (isZero(index) && amount >= length) {return []}const newList = Array(length - Math.abs(index) - 1)for (let i = 0; i < index; ++i) {newList[i] = list[i]}for (let i = index + amount; i < length; ++i) {newList[i - amount] = list[i]}return newList}) as {<A>(index: number, amount: number, list: ReadonlyArray<A>): A[](index: number, amount: number): <A>(list: ReadonlyArray<A>) => A[](index: number): {<A>(amount: number, list: ReadonlyArray<A>): A[](amount: number): <A>(list: ReadonlyArray<A>) => A[]}}
Type declaration
-
- <A>(index: number, amount: number, list: ReadonlyArray<A>): A[]
- (index: number, amount: number): <A>(list: ReadonlyArray<A>) => A[]
- (index: number): { <A>(amount: number, list: ReadonlyArray<A>): A[]; (amount: number): <A>(list: ReadonlyArray<A>) => A[] }
-
Type parameters
Parameters
-
index: number
-
amount: number
-
list: ReadonlyArray<A>
Returns A[]
-
Parameters
-
index: number
-
amount: number
Returns <A>(list: ReadonlyArray<A>) => A[]
-
- <A>(list: ReadonlyArray<A>): A[]
-
Type parameters
Parameters
Returns A[]
-
Parameters
Returns { <A>(amount: number, list: ReadonlyArray<A>): A[]; (amount: number): <A>(list: ReadonlyArray<A>) => A[] }
-
- <A>(amount: number, list: ReadonlyArray<A>): A[]
- (amount: number): <A>(list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
amount: number
-
list: ReadonlyArray<A>
Returns A[]
-
Parameters
Returns <A>(list: ReadonlyArray<A>) => A[]
-
- <A>(list: ReadonlyArray<A>): A[]
-
Type parameters
Parameters
Returns A[]
Const slice
slice: { <A>(from: number, to: number, list: ArrayLike<A>): A[]; (from: number, to: number): <A>(list: ArrayLike<A>) => A[]; (from: number): { <A>(to: number, list: ArrayLike<A>): A[]; (to: number): <A>(list: ArrayLike<A>) => A[] } } = curry(<A>(from: number, to: number, list: ArrayLike<A>): A[] =>Array.from(list).slice(from, to),) as {<A>(from: number, to: number, list: ArrayLike<A>): A[](from: number, to: number): <A>(list: ArrayLike<A>) => A[](from: number): {<A>(to: number, list: ArrayLike<A>): A[](to: number): <A>(list: ArrayLike<A>) => A[]}}
Type declaration
-
- <A>(from: number, to: number, list: ArrayLike<A>): A[]
- (from: number, to: number): <A>(list: ArrayLike<A>) => A[]
- (from: number): { <A>(to: number, list: ArrayLike<A>): A[]; (to: number): <A>(list: ArrayLike<A>) => A[] }
-
Type parameters
Parameters
-
from: number
-
to: number
-
list: ArrayLike<A>
Returns A[]
-
Parameters
Returns <A>(list: ArrayLike<A>) => A[]
-
- <A>(list: ArrayLike<A>): A[]
-
Type parameters
Parameters
Returns A[]
-
Parameters
Returns { <A>(to: number, list: ArrayLike<A>): A[]; (to: number): <A>(list: ArrayLike<A>) => A[] }
-
- <A>(to: number, list: ArrayLike<A>): A[]
- (to: number): <A>(list: ArrayLike<A>) => A[]
-
Type parameters
Parameters
-
to: number
-
list: ArrayLike<A>
Returns A[]
-
Parameters
Returns <A>(list: ArrayLike<A>) => A[]
-
- <A>(list: ArrayLike<A>): A[]
-
Type parameters
Parameters
Returns A[]
Const sort
sort
: { <A>
(sortFn
: SortFn<A>, list
: ReadonlyArray<A>): A[]; <A>
(sortFn
: SortFn<A>): (list
: ReadonlyArray<A>) => A[] } = curry(<A>(sortFn: SortFn<A>, list: ReadonlyArray<A>): A[] =>list.slice().sort(sortFn),) as {<A>(sortFn: SortFn<A>, list: ReadonlyArray<A>): A[]<A>(sortFn: SortFn<A>): (list: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A>(sortFn: SortFn<A>, list: ReadonlyArray<A>): A[]
- <A>(sortFn: SortFn<A>): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const splitAt
split
At: { <A>(index: number, list: ReadonlyArray<A>): Tuple<A[], A[]>; <A>(index: number): (list: ReadonlyArray<A>) => Tuple<A[], A[]> } = curry(<A>(index: number, list: ReadonlyArray<A>): Tuple<A[], A[]> => [list.slice(0, index),list.slice(index),],) as {<A>(index: number, list: ReadonlyArray<A>): Tuple<A[], A[]><A>(index: number): (list: ReadonlyArray<A>) => Tuple<A[], A[]>}
Type declaration
-
- <A>(index: number, list: ReadonlyArray<A>): Tuple<A[], A[]>
- <A>(index: number): (list: ReadonlyArray<A>) => Tuple<A[], A[]>
-
Type parameters
Parameters
-
index: number
-
list: ReadonlyArray<A>
Returns Tuple<A[], A[]>
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => Tuple<A[], A[]>
-
- (list: ReadonlyArray<A>): Tuple<A[], A[]>
-
Parameters
Returns Tuple<A[], A[]>
Const splitEvery
splitEvery: { <A>(amount: number, list: ReadonlyArray<A>): A[][]; <A>(amount: number): (list: ReadonlyArray<A>) => A[][] } = curry(function splitEvery<A>(amount: number,list: ReadonlyArray<A>,): A[][] {if (amount <= 0) {return [list.slice()]}const result: A[][] = []let i = 0while (i < list.length) {result.push(list.slice(i, (i += amount)))}return result}) as {<A>(amount: number, list: ReadonlyArray<A>): A[][]<A>(amount: number): (list: ReadonlyArray<A>) => A[][]}
Type declaration
-
- <A>(amount: number, list: ReadonlyArray<A>): A[][]
- <A>(amount: number): (list: ReadonlyArray<A>) => A[][]
-
Type parameters
Parameters
-
amount: number
-
list: ReadonlyArray<A>
Returns A[][]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[][]
-
- (list: ReadonlyArray<A>): A[][]
Const startsWith
startsWith: { <A>(search: ArrayLike<A>, list: ArrayLike<A>): boolean; <A>(search: ArrayLike<A>): (list: ArrayLike<A>) => boolean } = curry(__startsWith) as {<A>(search: ArrayLike<A>, list: ArrayLike<A>): boolean<A>(search: ArrayLike<A>): (list: ArrayLike<A>) => boolean}
Type declaration
-
- <A>(search: ArrayLike<A>, list: ArrayLike<A>): boolean
- <A>(search: ArrayLike<A>): (list: ArrayLike<A>) => boolean
-
Type parameters
Parameters
-
search: ArrayLike<A>
-
list: ArrayLike<A>
Returns boolean
-
Type parameters
Parameters
Returns (list: ArrayLike<A>) => boolean
-
- (list: ArrayLike<A>): boolean
-
Parameters
Returns boolean
Const take
take: { <A>(n: number, list: ReadonlyArray<A>): A[]; <A>(n: number): (list: ReadonlyArray<A>) => A[] } = curry(<A>(n: number, list: ReadonlyArray<A>) =>list.slice(0, n < 0 ? Infinity : n),) as {<A>(n: number, list: ReadonlyArray<A>): A[]<A>(n: number): (list: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A>(n: number, list: ReadonlyArray<A>): A[]
- <A>(n: number): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
n: number
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const takeLast
takeLast: { <A>(n: number, list: ReadonlyArray<A>): A[]; <A>(n: number): (list: ReadonlyArray<A>) => A[] } = curry(<A>(n: number, list: ReadonlyArray<A>) =>drop(n >= 0 ? list.length - n : 0, list),) as {<A>(n: number, list: ReadonlyArray<A>): A[]<A>(n: number): (list: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A>(n: number, list: ReadonlyArray<A>): A[]
- <A>(n: number): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
n: number
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const takeLastWhile
takeLastWhile: { <A>(f: (a: A, i: number) => boolean, list: ArrayLike<A>): A[]; <A>(f: (a: A, i: number) => boolean): (list: ArrayLike<A>) => A[] } = curry(_takeLastWhile)
Type declaration
-
- <A>(f: (a: A, i: number) => boolean, list: ArrayLike<A>): A[]
- <A>(f: (a: A, i: number) => boolean): (list: ArrayLike<A>) => A[]
-
Type parameters
Parameters
-
f: (a: A, i: number) => boolean
-
- (a: A, i: number): boolean
-
Parameters
Returns boolean
-
list: ArrayLike<A>
Returns A[]
-
Type parameters
Parameters
-
f: (a: A, i: number) => boolean
-
- (a: A, i: number): boolean
-
Parameters
Returns boolean
Returns (list: ArrayLike<A>) => A[]
-
- (list: ArrayLike<A>): A[]
Const takeWhile
takeWhile: { <A>(f: (a: A, i: number) => boolean, list: ArrayLike<A>): A[]; <A>(f: (a: A, i: number) => boolean): (list: ArrayLike<A>) => A[] } = curry(_takeWhile)
Type declaration
-
- <A>(f: (a: A, i: number) => boolean, list: ArrayLike<A>): A[]
- <A>(f: (a: A, i: number) => boolean): (list: ArrayLike<A>) => A[]
-
Type parameters
Parameters
-
f: (a: A, i: number) => boolean
-
- (a: A, i: number): boolean
-
Parameters
Returns boolean
-
list: ArrayLike<A>
Returns A[]
-
Type parameters
Parameters
-
f: (a: A, i: number) => boolean
-
- (a: A, i: number): boolean
-
Parameters
Returns boolean
Returns (list: ArrayLike<A>) => A[]
-
- (list: ArrayLike<A>): A[]
Const uniq
uniq: <A>(list: ReadonlyArray<A>) => A[] = uniqBy(id)
Type declaration
-
- <A>(list: ReadonlyArray<A>): A[]
-
Type parameters
Parameters
Returns A[]
Const uniqBy
uniqBy: { <A, B>(toComparisonValue: (value: A, index: number) => B, list: ReadonlyArray<A>): A[]; <A, B>(toComparisonValue: (value: A, index: number) => B): (list: ReadonlyArray<A>) => A[] } = curry(<A, B>(toComparisonValue: (value: A, index: number) => B, list: ReadonlyArray<A>): A[] => {const valuesSeen: B[] = []const result: A[] = []// tslint:disable-next-line:prefer-for-offor (let i = 0; i < list.length; ++i) {const value = list[i]const comparisonValue = toComparisonValue(value, i)const valueHasBeenSeen = includes(comparisonValue, valuesSeen)if (!valueHasBeenSeen) {valuesSeen.push(comparisonValue)result.push(value)}}return result},) as {<A, B>(toComparisonValue: (value: A, index: number) => B, list: ReadonlyArray<A>): A[]<A, B>(toComparisonValue: (value: A, index: number) => B): (list: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A, B>(toComparisonValue: (value: A, index: number) => B, list: ReadonlyArray<A>): A[]
- <A, B>(toComparisonValue: (value: A, index: number) => B): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
toComparisonValue: (value: A, index: number) => B
-
- (value: A, index: number): B
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
-
toComparisonValue: (value: A, index: number) => B
-
- (value: A, index: number): B
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const update
update: { <A>(index: number, value: A, list: ReadonlyArray<A>): A[]; <A>(index: number, value: A): (list: ReadonlyArray<A>) => A[]; (index: number): { <A>(value: A, list: ReadonlyArray<A>): A[]; <A>(value: A): (list: ReadonlyArray<A>) => A[] } } = curry(function update<A>(index: number,value: A,list: ReadonlyArray<A>,): A[] {const length = list.lengthconst newList = list.slice()if (length === 0 || index < 0 || index >= length) {return newList}newList[index] = valuereturn newList}) as {<A>(index: number, value: A, list: ReadonlyArray<A>): A[]<A>(index: number, value: A): (list: ReadonlyArray<A>) => A[](index: number): {<A>(value: A, list: ReadonlyArray<A>): A[]<A>(value: A): (list: ReadonlyArray<A>) => A[]}}
Type declaration
-
- <A>(index: number, value: A, list: ReadonlyArray<A>): A[]
- <A>(index: number, value: A): (list: ReadonlyArray<A>) => A[]
- (index: number): { <A>(value: A, list: ReadonlyArray<A>): A[]; <A>(value: A): (list: ReadonlyArray<A>) => A[] }
-
Type parameters
Parameters
-
index: number
-
value: A
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
-
Parameters
Returns { <A>(value: A, list: ReadonlyArray<A>): A[]; <A>(value: A): (list: ReadonlyArray<A>) => A[] }
-
- <A>(value: A, list: ReadonlyArray<A>): A[]
- <A>(value: A): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
value: A
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const without
without: { <A>(values: A[], list: ReadonlyArray<A>): A[]; <A>(values: A[]): (list: ReadonlyArray<A>) => A[] } = curry(__without) as {<A>(values: A[], list: ReadonlyArray<A>): A[]<A>(values: A[]): (list: ReadonlyArray<A>) => A[]}
Type declaration
-
- <A>(values: A[], list: ReadonlyArray<A>): A[]
- <A>(values: A[]): (list: ReadonlyArray<A>) => A[]
-
Type parameters
Parameters
-
values: A[]
-
list: ReadonlyArray<A>
Returns A[]
-
Type parameters
Parameters
Returns (list: ReadonlyArray<A>) => A[]
-
- (list: ReadonlyArray<A>): A[]
Const zip
zip: { <A, B>(xs: ReadonlyArray<A>, ys: ReadonlyArray<B>): [A, B][]; <A>(xs: ReadonlyArray<A>): <B>(ys: ReadonlyArray<B>) => [A, B][] } = curry(function zip<A, B>(xs: ReadonlyArray<A>, ys: ReadonlyArray<B>): [A, B][] {const length = Math.min(xs.length, ys.length)const newList = Array(length)for (let i = 0; i < length; ++i) {newList[i] = [xs[i], ys[i]]}return newList}) as {<A, B>(xs: ReadonlyArray<A>, ys: ReadonlyArray<B>): [A, B][]<A>(xs: ReadonlyArray<A>): <B>(ys: ReadonlyArray<B>) => [A, B][]}
Type declaration
-
- <A, B>(xs: ReadonlyArray<A>, ys: ReadonlyArray<B>): [A, B][]
- <A>(xs: ReadonlyArray<A>): <B>(ys: ReadonlyArray<B>) => [A, B][]
-
Type parameters
Parameters
-
xs: ReadonlyArray<A>
-
ys: ReadonlyArray<B>
Returns [A, B][]
-
Type parameters
Parameters
Returns <B>(ys: ReadonlyArray<B>) => [A, B][]
-
- <B>(ys: ReadonlyArray<B>): [A, B][]
-
Type parameters
Parameters
Returns [A, B][]
@typed/list