<AR, ER, RR>(right: Stream<AR, ER, RR>): <AL, EL, RL>(
left: Stream<AL, EL, RL>
) => Stream<AL, ER | EL, RR | RL>
<AL, EL, RL, AR, ER, RR>(
left: Stream<AL, EL, RL>,
right: Stream<AR, ER, RR>
): Stream<AL, EL | ER, RL | RR>Zips this stream with another point-wise and keeps only the values from the left stream.
Details
The resulting stream ends when either side ends.
Example (Zipping streams while keeping left values)
import { Console, Effect, Stream } from "effect"
const stream1 = Stream.make(1, 2, 3, 4)
const stream2 = Stream.make("a", "b")
const program = Effect.gen(function*() {
const result = yield* Stream.zipLeft(stream1, stream2).pipe(Stream.runCollect)
yield* Console.log(result)
})
Effect.runPromise(program)
// Output: [1, 2]export const const zipLeft: {
<AR, ER, RR>(right: Stream<AR, ER, RR>): <
AL,
EL,
RL
>(
left: Stream<AL, EL, RL>
) => Stream<AL, ER | EL, RR | RL>
<AL, EL, RL, AR, ER, RR>(
left: Stream<AL, EL, RL>,
right: Stream<AR, ER, RR>
): Stream<AL, EL | ER, RL | RR>
}
Zips this stream with another point-wise and keeps only the values from
the left stream.
Details
The resulting stream ends when either side ends.
Example (Zipping streams while keeping left values)
import { Console, Effect, Stream } from "effect"
const stream1 = Stream.make(1, 2, 3, 4)
const stream2 = Stream.make("a", "b")
const program = Effect.gen(function*() {
const result = yield* Stream.zipLeft(stream1, stream2).pipe(Stream.runCollect)
yield* Console.log(result)
})
Effect.runPromise(program)
// Output: [1, 2]
zipLeft: {
<function (type parameter) AR in <AR, ER, RR>(right: Stream<AR, ER, RR>): <AL, EL, RL>(left: Stream<AL, EL, RL>) => Stream<AL, ER | EL, RR | RL>AR, function (type parameter) ER in <AR, ER, RR>(right: Stream<AR, ER, RR>): <AL, EL, RL>(left: Stream<AL, EL, RL>) => Stream<AL, ER | EL, RR | RL>ER, function (type parameter) RR in <AR, ER, RR>(right: Stream<AR, ER, RR>): <AL, EL, RL>(left: Stream<AL, EL, RL>) => Stream<AL, ER | EL, RR | RL>RR>(right: Stream<AR, ER, RR>(parameter) right: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
right: interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) AR in <AR, ER, RR>(right: Stream<AR, ER, RR>): <AL, EL, RL>(left: Stream<AL, EL, RL>) => Stream<AL, ER | EL, RR | RL>AR, function (type parameter) ER in <AR, ER, RR>(right: Stream<AR, ER, RR>): <AL, EL, RL>(left: Stream<AL, EL, RL>) => Stream<AL, ER | EL, RR | RL>ER, function (type parameter) RR in <AR, ER, RR>(right: Stream<AR, ER, RR>): <AL, EL, RL>(left: Stream<AL, EL, RL>) => Stream<AL, ER | EL, RR | RL>RR>): <function (type parameter) AL in <AL, EL, RL>(left: Stream<AL, EL, RL>): Stream<AL, ER | EL, RR | RL>AL, function (type parameter) EL in <AL, EL, RL>(left: Stream<AL, EL, RL>): Stream<AL, ER | EL, RR | RL>EL, function (type parameter) RL in <AL, EL, RL>(left: Stream<AL, EL, RL>): Stream<AL, ER | EL, RR | RL>RL>(left: Stream<AL, EL, RL>(parameter) left: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
left: interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) AL in <AL, EL, RL>(left: Stream<AL, EL, RL>): Stream<AL, ER | EL, RR | RL>AL, function (type parameter) EL in <AL, EL, RL>(left: Stream<AL, EL, RL>): Stream<AL, ER | EL, RR | RL>EL, function (type parameter) RL in <AL, EL, RL>(left: Stream<AL, EL, RL>): Stream<AL, ER | EL, RR | RL>RL>) => interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) AL in <AL, EL, RL>(left: Stream<AL, EL, RL>): Stream<AL, ER | EL, RR | RL>AL, function (type parameter) ER in <AR, ER, RR>(right: Stream<AR, ER, RR>): <AL, EL, RL>(left: Stream<AL, EL, RL>) => Stream<AL, ER | EL, RR | RL>ER | function (type parameter) EL in <AL, EL, RL>(left: Stream<AL, EL, RL>): Stream<AL, ER | EL, RR | RL>EL, function (type parameter) RR in <AR, ER, RR>(right: Stream<AR, ER, RR>): <AL, EL, RL>(left: Stream<AL, EL, RL>) => Stream<AL, ER | EL, RR | RL>RR | function (type parameter) RL in <AL, EL, RL>(left: Stream<AL, EL, RL>): Stream<AL, ER | EL, RR | RL>RL>
<function (type parameter) AL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AL, function (type parameter) EL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>EL, function (type parameter) RL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RL, function (type parameter) AR in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AR, function (type parameter) ER in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>ER, function (type parameter) RR in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RR>(left: Stream<AL, EL, RL>(parameter) left: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
left: interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) AL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AL, function (type parameter) EL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>EL, function (type parameter) RL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RL>, right: Stream<AR, ER, RR>(parameter) right: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
right: interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) AR in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AR, function (type parameter) ER in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>ER, function (type parameter) RR in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RR>): interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) AL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AL, function (type parameter) EL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>EL | function (type parameter) ER in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>ER, function (type parameter) RL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RL | function (type parameter) RR in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RR>
} = dual<(...args: Array<any>) => any, <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>) => Stream<AL, EL | ER, RL | RR>>(arity: 2, body: <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>) => Stream<AL, EL | ER, RL | RR>): ((...args: Array<any>) => any) & (<AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>) => Stream<AL, EL | ER, RL | RR>) (+1 overload)Creates a function that can be called in data-first style or data-last
(pipe-friendly) style.
When to use
Use to expose one implementation through both direct and pipe-friendly
call styles.
Details
Pass either the arity of the uncurried function or a predicate that decides
whether the current call is data-first. Arity is the common case. Use a
predicate when optional arguments make arity ambiguous.
Example (Selecting data-first or data-last style by arity)
import { Function, pipe } from "effect"
const sum = Function.dual<
(that: number) => (self: number) => number,
(self: number, that: number) => number
>(2, (self, that) => self + that)
console.log(sum(2, 3)) // 5
console.log(pipe(2, sum(3))) // 5
Example (Defining overloads with call signatures)
import { Function, pipe } from "effect"
const sum: {
(that: number): (self: number) => number
(self: number, that: number): number
} = Function.dual(2, (self: number, that: number): number => self + that)
console.log(sum(2, 3)) // 5
console.log(pipe(2, sum(3))) // 5
Example (Selecting data-first or data-last style with a predicate)
import { Function, pipe } from "effect"
const sum = Function.dual<
(that: number) => (self: number) => number,
(self: number, that: number) => number
>(
(args) => args.length === 2,
(self, that) => self + that
)
console.log(sum(2, 3)) // 5
console.log(pipe(2, sum(3))) // 5
dual(
2,
<function (type parameter) AL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AL, function (type parameter) EL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>EL, function (type parameter) RL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RL, function (type parameter) AR in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AR, function (type parameter) ER in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>ER, function (type parameter) RR in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RR>(
left: Stream<AL, EL, RL>(parameter) left: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
left: interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) AL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AL, function (type parameter) EL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>EL, function (type parameter) RL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RL>,
right: Stream<AR, ER, RR>(parameter) right: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
right: interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) AR in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AR, function (type parameter) ER in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>ER, function (type parameter) RR in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RR>
): interface Stream<out A, out E = never, out R = never>A Stream<A, E, R> describes a program that can emit many A values, fail
with E, and require R.
Details
Streams are pull-based with backpressure and emit chunks to amortize effect
evaluation. They support monadic composition and error handling similar to
Effect, adapted for multiple values.
Example (Creating and consuming streams)
import { Console, Effect, Stream } from "effect"
const program = Effect.gen(function*() {
yield* Stream.make(1, 2, 3).pipe(
Stream.map((n) => n * 2),
Stream.runForEach((n) => Console.log(n))
)
})
Effect.runPromise(program)
// Output:
// 2
// 4
// 6
Stream<function (type parameter) AL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AL, function (type parameter) EL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>EL | function (type parameter) ER in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>ER, function (type parameter) RL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RL | function (type parameter) RR in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>RR> =>
const zipWithArray: {
<AR, ER, RR, AL, A>(
right: Stream<AR, ER, RR>,
f: (
left: Arr.NonEmptyReadonlyArray<AL>,
right: Arr.NonEmptyReadonlyArray<AR>
) => readonly [
output: Arr.NonEmptyReadonlyArray<A>,
leftoverLeft: ReadonlyArray<AL>,
leftoverRight: ReadonlyArray<AR>
]
): <EL, RL>(
left: Stream<AL, EL, RL>
) => Stream<A, EL | ER, RL | RR>
<AL, EL, RL, AR, ER, RR, A>(
left: Stream<AL, EL, RL>,
right: Stream<AR, ER, RR>,
f: (
left: Arr.NonEmptyReadonlyArray<AL>,
right: Arr.NonEmptyReadonlyArray<AR>
) => readonly [
output: Arr.NonEmptyReadonlyArray<A>,
leftoverLeft: ReadonlyArray<AL>,
leftoverRight: ReadonlyArray<AR>
]
): Stream<A, EL | ER, RL | RR>
}
zipWithArray(left: Stream<AL, EL, RL>(parameter) left: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
left, right: Stream<AR, ER, RR>(parameter) right: {
channel: Channel.Channel<Arr.NonEmptyReadonlyArray<A>, E, void, unknown, unknown, unknown, R>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
right, (leftArr: readonly [AL, ...AL[]](parameter) leftArr: {
0: AL;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<AL>>): Array<AL>; (...items: Array<AL | ConcatArray<AL>>): Array<AL> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<AL>;
indexOf: (searchElement: AL, fromIndex?: number) => number;
lastIndexOf: (searchElement: AL, fromIndex?: number) => number;
every: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AL, index: number, array: ReadonlyArray<AL>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AL, index: number, array: ReadonlyArray<AL>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): Array<AL> };
reduce: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL, initialValue: AL): A…;
reduceRight: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL, initialValue: AL): A…;
find: { (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => unknown, thisArg?: any): AL | undefined };
findIndex: (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, AL]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AL>;
includes: (searchElement: AL, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AL, index: number, array: Array<AL>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => AL | undefined;
findLast: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): AL | undefined };
findLastIndex: (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AL>;
toSorted: (compareFn?: ((a: AL, b: AL) => number) | undefined) => Array<AL>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AL>): Array<AL>; (start: number, deleteCount?: number): Array<AL> };
with: (index: number, value: AL) => Array<AL>;
}
leftArr, rightArr: readonly [AR, ...AR[]](parameter) rightArr: {
0: AR;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<AR>>): Array<AR>; (...items: Array<AR | ConcatArray<AR>>): Array<AR> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<AR>;
indexOf: (searchElement: AR, fromIndex?: number) => number;
lastIndexOf: (searchElement: AR, fromIndex?: number) => number;
every: { (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AR, index: number, array: ReadonlyArray<AR>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AR, index: number, array: ReadonlyArray<AR>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any): Array<AR> };
reduce: { (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR): AR; (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR, initialValue: AR): A…;
reduceRight: { (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR): AR; (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR, initialValue: AR): A…;
find: { (predicate: (value: AR, index: number, obj: ReadonlyArray<AR>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AR, index: number, obj: ReadonlyArray<AR>) => unknown, thisArg?: any): AR | undefined };
findIndex: (predicate: (value: AR, index: number, obj: ReadonlyArray<AR>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, AR]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AR>;
includes: (searchElement: AR, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AR, index: number, array: Array<AR>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => AR | undefined;
findLast: { (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any): AR | undefined };
findLastIndex: (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AR>;
toSorted: (compareFn?: ((a: AR, b: AR) => number) | undefined) => Array<AR>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AR>): Array<AR>; (start: number, deleteCount?: number): Array<AR> };
with: (index: number, value: AR) => Array<AR>;
}
rightArr) => {
const const minLength: numberminLength = var Math: MathAn intrinsic object that provides basic mathematics functionality and constants.
Math.Math.min(...values: number[]): numberReturns the smaller of a set of supplied numeric expressions.
min(leftArr: readonly [AL, ...AL[]](parameter) leftArr: {
0: AL;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<AL>>): Array<AL>; (...items: Array<AL | ConcatArray<AL>>): Array<AL> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<AL>;
indexOf: (searchElement: AL, fromIndex?: number) => number;
lastIndexOf: (searchElement: AL, fromIndex?: number) => number;
every: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AL, index: number, array: ReadonlyArray<AL>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AL, index: number, array: ReadonlyArray<AL>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): Array<AL> };
reduce: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL, initialValue: AL): A…;
reduceRight: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL, initialValue: AL): A…;
find: { (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => unknown, thisArg?: any): AL | undefined };
findIndex: (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, AL]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AL>;
includes: (searchElement: AL, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AL, index: number, array: Array<AL>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => AL | undefined;
findLast: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): AL | undefined };
findLastIndex: (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AL>;
toSorted: (compareFn?: ((a: AL, b: AL) => number) | undefined) => Array<AL>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AL>): Array<AL>; (start: number, deleteCount?: number): Array<AL> };
with: (index: number, value: AL) => Array<AL>;
}
leftArr.length: numberlength, rightArr: readonly [AR, ...AR[]](parameter) rightArr: {
0: AR;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<AR>>): Array<AR>; (...items: Array<AR | ConcatArray<AR>>): Array<AR> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<AR>;
indexOf: (searchElement: AR, fromIndex?: number) => number;
lastIndexOf: (searchElement: AR, fromIndex?: number) => number;
every: { (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AR, index: number, array: ReadonlyArray<AR>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AR, index: number, array: ReadonlyArray<AR>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any): Array<AR> };
reduce: { (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR): AR; (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR, initialValue: AR): A…;
reduceRight: { (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR): AR; (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR, initialValue: AR): A…;
find: { (predicate: (value: AR, index: number, obj: ReadonlyArray<AR>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AR, index: number, obj: ReadonlyArray<AR>) => unknown, thisArg?: any): AR | undefined };
findIndex: (predicate: (value: AR, index: number, obj: ReadonlyArray<AR>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, AR]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AR>;
includes: (searchElement: AR, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AR, index: number, array: Array<AR>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => AR | undefined;
findLast: { (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any): AR | undefined };
findLastIndex: (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AR>;
toSorted: (compareFn?: ((a: AR, b: AR) => number) | undefined) => Array<AR>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AR>): Array<AR>; (start: number, deleteCount?: number): Array<AR> };
with: (index: number, value: AR) => Array<AR>;
}
rightArr.length: numberlength)
const const output: [AL, ...AL[]]const output: {
0: AL;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
pop: () => AL | undefined;
push: (...items: Array<AL>) => number;
concat: { (...items: Array<ConcatArray<AL>>): Array<AL>; (...items: Array<AL | ConcatArray<AL>>): Array<AL> };
join: (separator?: string) => string;
reverse: () => Array<AL>;
shift: () => AL | undefined;
slice: (start?: number, end?: number) => Array<AL>;
sort: (compareFn?: ((a: AL, b: AL) => number) | undefined) => [AL, ...AL[]];
splice: { (start: number, deleteCount?: number): Array<AL>; (start: number, deleteCount: number, ...items: Array<AL>): Array<AL> };
unshift: (...items: Array<AL>) => number;
indexOf: (searchElement: AL, fromIndex?: number) => number;
lastIndexOf: (searchElement: AL, fromIndex?: number) => number;
every: { (predicate: (value: AL, index: number, array: Array<AL>) => value is S, thisArg?: any): this is S[]; (predicate: (value: AL, index: number, array: Array<AL>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: AL, index: number, array: Array<AL>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AL, index: number, array: Array<AL>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AL, index: number, array: Array<AL>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AL, index: number, array: Array<AL>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AL, index: number, array: Array<AL>) => unknown, thisArg?: any): Array<AL> };
reduce: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: Array<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: Array<AL>) => AL, initialValue: AL): AL; (callbackfn: …;
reduceRight: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: Array<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: Array<AL>) => AL, initialValue: AL): AL; (callbackfn: …;
find: { (predicate: (value: AL, index: number, obj: Array<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, obj: Array<AL>) => unknown, thisArg?: any): AL | undefined };
findIndex: (predicate: (value: AL, index: number, obj: Array<AL>) => unknown, thisArg?: any) => number;
fill: (value: AL, start?: number, end?: number) => [AL, ...AL[]];
copyWithin: (target: number, start: number, end?: number) => [AL, ...AL[]];
entries: () => ArrayIterator<[number, AL]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AL>;
includes: (searchElement: AL, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AL, index: number, array: Array<AL>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => AL | undefined;
findLast: { (predicate: (value: AL, index: number, array: Array<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, array: Array<AL>) => unknown, thisArg?: any): AL | undefined };
findLastIndex: (predicate: (value: AL, index: number, array: Array<AL>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AL>;
toSorted: (compareFn?: ((a: AL, b: AL) => number) | undefined) => Array<AL>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AL>): Array<AL>; (start: number, deleteCount?: number): Array<AL> };
with: (index: number, value: AL) => Array<AL>;
}
output = leftArr: readonly [AL, ...AL[]](parameter) leftArr: {
0: AL;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<AL>>): Array<AL>; (...items: Array<AL | ConcatArray<AL>>): Array<AL> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<AL>;
indexOf: (searchElement: AL, fromIndex?: number) => number;
lastIndexOf: (searchElement: AL, fromIndex?: number) => number;
every: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AL, index: number, array: ReadonlyArray<AL>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AL, index: number, array: ReadonlyArray<AL>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): Array<AL> };
reduce: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL, initialValue: AL): A…;
reduceRight: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL, initialValue: AL): A…;
find: { (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => unknown, thisArg?: any): AL | undefined };
findIndex: (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, AL]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AL>;
includes: (searchElement: AL, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AL, index: number, array: Array<AL>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => AL | undefined;
findLast: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): AL | undefined };
findLastIndex: (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AL>;
toSorted: (compareFn?: ((a: AL, b: AL) => number) | undefined) => Array<AL>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AL>): Array<AL>; (start: number, deleteCount?: number): Array<AL> };
with: (index: number, value: AL) => Array<AL>;
}
leftArr.ReadonlyArray<AL>.slice(start?: number, end?: number): AL[]Returns a section of an array.
slice(0, const minLength: numberminLength) as import ArrArr.type NonEmptyArray<A> = [A, ...A[]]A mutable array guaranteed to have at least one element.
When to use
Use when mutation is acceptable and non-emptiness must be tracked at the type
level.
Details
This is the mutable counterpart of
NonEmptyReadonlyArray
. Most Array
module functions return NonEmptyArray when the result is guaranteed
non-empty.
Example (Typing a mutable non-empty array)
import type { Array } from "effect"
const nonEmpty: Array.NonEmptyArray<number> = [1, 2, 3]
nonEmpty.push(4)
NonEmptyArray<function (type parameter) AL in <AL, EL, RL, AR, ER, RR>(left: Stream<AL, EL, RL>, right: Stream<AR, ER, RR>): Stream<AL, EL | ER, RL | RR>AL>
const const leftoverLeft: AL[]leftoverLeft = leftArr: readonly [AL, ...AL[]](parameter) leftArr: {
0: AL;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<AL>>): Array<AL>; (...items: Array<AL | ConcatArray<AL>>): Array<AL> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<AL>;
indexOf: (searchElement: AL, fromIndex?: number) => number;
lastIndexOf: (searchElement: AL, fromIndex?: number) => number;
every: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AL, index: number, array: ReadonlyArray<AL>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AL, index: number, array: ReadonlyArray<AL>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): Array<AL> };
reduce: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL, initialValue: AL): A…;
reduceRight: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: ReadonlyArray<AL>) => AL, initialValue: AL): A…;
find: { (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => unknown, thisArg?: any): AL | undefined };
findIndex: (predicate: (value: AL, index: number, obj: ReadonlyArray<AL>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, AL]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AL>;
includes: (searchElement: AL, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AL, index: number, array: Array<AL>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => AL | undefined;
findLast: { (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any): AL | undefined };
findLastIndex: (predicate: (value: AL, index: number, array: ReadonlyArray<AL>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AL>;
toSorted: (compareFn?: ((a: AL, b: AL) => number) | undefined) => Array<AL>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AL>): Array<AL>; (start: number, deleteCount?: number): Array<AL> };
with: (index: number, value: AL) => Array<AL>;
}
leftArr.ReadonlyArray<AL>.slice(start?: number, end?: number): AL[]Returns a section of an array.
slice(const minLength: numberminLength)
const const leftoverRight: AR[]leftoverRight = rightArr: readonly [AR, ...AR[]](parameter) rightArr: {
0: AR;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<AR>>): Array<AR>; (...items: Array<AR | ConcatArray<AR>>): Array<AR> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<AR>;
indexOf: (searchElement: AR, fromIndex?: number) => number;
lastIndexOf: (searchElement: AR, fromIndex?: number) => number;
every: { (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AR, index: number, array: ReadonlyArray<AR>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AR, index: number, array: ReadonlyArray<AR>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any): Array<AR> };
reduce: { (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR): AR; (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR, initialValue: AR): A…;
reduceRight: { (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR): AR; (callbackfn: (previousValue: AR, currentValue: AR, currentIndex: number, array: ReadonlyArray<AR>) => AR, initialValue: AR): A…;
find: { (predicate: (value: AR, index: number, obj: ReadonlyArray<AR>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AR, index: number, obj: ReadonlyArray<AR>) => unknown, thisArg?: any): AR | undefined };
findIndex: (predicate: (value: AR, index: number, obj: ReadonlyArray<AR>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, AR]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AR>;
includes: (searchElement: AR, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AR, index: number, array: Array<AR>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => AR | undefined;
findLast: { (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any): AR | undefined };
findLastIndex: (predicate: (value: AR, index: number, array: ReadonlyArray<AR>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AR>;
toSorted: (compareFn?: ((a: AR, b: AR) => number) | undefined) => Array<AR>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AR>): Array<AR>; (start: number, deleteCount?: number): Array<AR> };
with: (index: number, value: AR) => Array<AR>;
}
rightArr.ReadonlyArray<AR>.slice(start?: number, end?: number): AR[]Returns a section of an array.
slice(const minLength: numberminLength)
return [const output: [AL, ...AL[]]const output: {
0: AL;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
pop: () => AL | undefined;
push: (...items: Array<AL>) => number;
concat: { (...items: Array<ConcatArray<AL>>): Array<AL>; (...items: Array<AL | ConcatArray<AL>>): Array<AL> };
join: (separator?: string) => string;
reverse: () => Array<AL>;
shift: () => AL | undefined;
slice: (start?: number, end?: number) => Array<AL>;
sort: (compareFn?: ((a: AL, b: AL) => number) | undefined) => [AL, ...AL[]];
splice: { (start: number, deleteCount?: number): Array<AL>; (start: number, deleteCount: number, ...items: Array<AL>): Array<AL> };
unshift: (...items: Array<AL>) => number;
indexOf: (searchElement: AL, fromIndex?: number) => number;
lastIndexOf: (searchElement: AL, fromIndex?: number) => number;
every: { (predicate: (value: AL, index: number, array: Array<AL>) => value is S, thisArg?: any): this is S[]; (predicate: (value: AL, index: number, array: Array<AL>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: AL, index: number, array: Array<AL>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: AL, index: number, array: Array<AL>) => void, thisArg?: any) => void;
map: (callbackfn: (value: AL, index: number, array: Array<AL>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: AL, index: number, array: Array<AL>) => value is S, thisArg?: any): Array<S>; (predicate: (value: AL, index: number, array: Array<AL>) => unknown, thisArg?: any): Array<AL> };
reduce: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: Array<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: Array<AL>) => AL, initialValue: AL): AL; (callbackfn: …;
reduceRight: { (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: Array<AL>) => AL): AL; (callbackfn: (previousValue: AL, currentValue: AL, currentIndex: number, array: Array<AL>) => AL, initialValue: AL): AL; (callbackfn: …;
find: { (predicate: (value: AL, index: number, obj: Array<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, obj: Array<AL>) => unknown, thisArg?: any): AL | undefined };
findIndex: (predicate: (value: AL, index: number, obj: Array<AL>) => unknown, thisArg?: any) => number;
fill: (value: AL, start?: number, end?: number) => [AL, ...AL[]];
copyWithin: (target: number, start: number, end?: number) => [AL, ...AL[]];
entries: () => ArrayIterator<[number, AL]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<AL>;
includes: (searchElement: AL, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: AL, index: number, array: Array<AL>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => AL | undefined;
findLast: { (predicate: (value: AL, index: number, array: Array<AL>) => value is S, thisArg?: any): S | undefined; (predicate: (value: AL, index: number, array: Array<AL>) => unknown, thisArg?: any): AL | undefined };
findLastIndex: (predicate: (value: AL, index: number, array: Array<AL>) => unknown, thisArg?: any) => number;
toReversed: () => Array<AL>;
toSorted: (compareFn?: ((a: AL, b: AL) => number) | undefined) => Array<AL>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<AL>): Array<AL>; (start: number, deleteCount?: number): Array<AL> };
with: (index: number, value: AL) => Array<AL>;
}
output, const leftoverLeft: AL[]leftoverLeft, const leftoverRight: AR[]leftoverRight] as type const = readonly [[AL, ...AL[]], AL[], AR[]]const
})
)