<A, L, A2, E2, R2, L2 = never>(
f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>
): <In, E, R>(
self: Sink<A, In, L, E, R>
) => Sink<A2, In, L2, E2 | E, R2 | R>
<A, In, L, E, R, A2, E2, R2, L2 = never>(
self: Sink<A, In, L, E, R>,
f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>
): Sink<A2, In, L2, E | E2, R | R2>Transforms the full End produced by this sink effectfully.
Details
This can change both the result value and the optional leftovers, and the transformation can fail or require services.
export const const mapEffectEnd: {
<A, L, A2, E2, R2, L2 = never>(
f: (
end: End<A, L>
) => Effect.Effect<End<A2, L2>, E2, R2>
): <In, E, R>(
self: Sink<A, In, L, E, R>
) => Sink<A2, In, L2, E2 | E, R2 | R>
<A, In, L, E, R, A2, E2, R2, L2 = never>(
self: Sink<A, In, L, E, R>,
f: (
end: End<A, L>
) => Effect.Effect<End<A2, L2>, E2, R2>
): Sink<A2, In, L2, E | E2, R | R2>
}
Transforms the full End produced by this sink effectfully.
Details
This can change both the result value and the optional leftovers, and the
transformation can fail or require services.
mapEffectEnd: {
<function (type parameter) A in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>A, function (type parameter) L in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>L, function (type parameter) A2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>A2, function (type parameter) E2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>E2, function (type parameter) R2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>R2, function (type parameter) L2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>L2 = never>(
f: (
end: End<A, L>
) => Effect.Effect<End<A2, L2>, E2, R2>
f: (end: End<A, L>(parameter) end: {
0: A;
1: readonly [L, ...L[]] | undefined;
length: 2 | 1;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<A | readonly [L, ...L[]] | undefined>>): Array<A | readonly [L, ...L[]] | undefined>; (...items: Array<A | readonly [L, ...L[]] | ConcatArray<A | readonly [L, ...L[]] | undefined> | undefined>): Array<A | rea…;
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<A | readonly [L, ...L[]] | undefined>;
indexOf: (searchElement: A | readonly [L, ...L[]] | undefined, fromIndex?: number) => number;
lastIndexOf: (searchElement: A | readonly [L, ...L[]] | undefined, fromIndex?: number) => number;
every: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: A | readonly [L, ...L[]] | unde…;
some: (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => void, thisArg?: any) => void;
map: (callbackfn: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): Array<S>; (predicate: (value: A | readonly [L, ...L[]] | undefined, index…;
reduce: { (callbackfn: (previousValue: A | readonly [L, ...L[]] | undefined, currentValue: A | readonly [L, ...L[]] | undefined, currentIndex: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => A | readonly [L, ...L[]] | undefi…;
reduceRight: { (callbackfn: (previousValue: A | readonly [L, ...L[]] | undefined, currentValue: A | readonly [L, ...L[]] | undefined, currentIndex: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => A | readonly [L, ...L[]] | undefi…;
find: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, obj: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A | readonly [L, ...L[]] | undefined, in…;
findIndex: (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, obj: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, A | readonly [L, ...L[]] | undefined]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<A | readonly [L, ...L[]] | undefined>;
includes: (searchElement: A | readonly [L, ...L[]] | undefined, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: A | readonly [L, ...L[]] | undefined, index: number, array: Array<A | readonly [L, ...L[]] | undefined>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => A | readonly [L, ...L[]] | undefined;
findLast: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A | readonly [L, ...L[]] | undefined, …;
findLastIndex: (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => unknown, thisArg?: any) => number;
toReversed: () => Array<A | readonly [L, ...L[]] | undefined>;
toSorted: (compareFn?: ((a: A | readonly [L, ...L[]] | undefined, b: A | readonly [L, ...L[]] | undefined) => number) | undefined) => Array<A | readonly [L, ...L[]] | undefined>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<A | readonly [L, ...L[]] | undefined>): Array<A | readonly [L, ...L[]] | undefined>; (start: number, deleteCount?: number): Array<A | readonly [L, ...L[]] | undefined> };
with: (index: number, value: A | readonly [L, ...L[]] | undefined) => Array<A | readonly [L, ...L[]] | undefined>;
}
end: type End<A, L = never> = readonly [
value: A,
leftover?: readonly [L, ...L[]] | undefined
]
Tuple returned when a Sink finishes.
Details
The first element is the sink result. The optional second element contains a
non-empty array of leftover input that was pulled but not consumed.
End<function (type parameter) A in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>A, function (type parameter) L in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>L>) => import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<type End<A, L = never> = readonly [
value: A,
leftover?: readonly [L, ...L[]] | undefined
]
Tuple returned when a Sink finishes.
Details
The first element is the sink result. The optional second element contains a
non-empty array of leftover input that was pulled but not consumed.
End<function (type parameter) A2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>A2, function (type parameter) L2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>L2>, function (type parameter) E2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>E2, function (type parameter) R2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>R2>
): <function (type parameter) In in <In, E, R>(self: Sink<A, In, L, E, R>): Sink<A2, In, L2, E2 | E, R2 | R>In, function (type parameter) E in <In, E, R>(self: Sink<A, In, L, E, R>): Sink<A2, In, L2, E2 | E, R2 | R>E, function (type parameter) R in <In, E, R>(self: Sink<A, In, L, E, R>): Sink<A2, In, L2, E2 | E, R2 | R>R>(self: Sink<A, In, L, E, R>(parameter) self: {
transform: (upstream: Pull.Pull<NonEmptyReadonlyArray<In>, never, void>, scope: Scope.Scope) => Effect.Effect<End<A, L>, E, 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; <…;
}
self: interface Sink<out A, in In = unknown, out L = never, out E = never, out R = never>A Sink<A, In, L, E, R> is used to consume elements produced by a Stream.
You can think of a sink as a function that will consume a variable amount of
In elements (could be 0, 1, or many), might fail with an error of type E,
and will eventually yield a value of type A together with a remainder of
type L (i.e. any leftovers).
Example (Running a sink with a stream)
import { Effect, Sink, Stream } from "effect"
// Create a simple sink that always succeeds with a value
const sink: Sink.Sink<number> = Sink.succeed(42)
// Use the sink to consume a stream
const stream = Stream.make(1, 2, 3)
const program = Stream.run(stream, sink)
Effect.runPromise(program).then(console.log)
// Output: 42
Namespace containing types and interfaces for Sink variance and type relationships.
Sink<function (type parameter) A in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>A, function (type parameter) In in <In, E, R>(self: Sink<A, In, L, E, R>): Sink<A2, In, L2, E2 | E, R2 | R>In, function (type parameter) L in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>L, function (type parameter) E in <In, E, R>(self: Sink<A, In, L, E, R>): Sink<A2, In, L2, E2 | E, R2 | R>E, function (type parameter) R in <In, E, R>(self: Sink<A, In, L, E, R>): Sink<A2, In, L2, E2 | E, R2 | R>R>) => interface Sink<out A, in In = unknown, out L = never, out E = never, out R = never>A Sink<A, In, L, E, R> is used to consume elements produced by a Stream.
You can think of a sink as a function that will consume a variable amount of
In elements (could be 0, 1, or many), might fail with an error of type E,
and will eventually yield a value of type A together with a remainder of
type L (i.e. any leftovers).
Example (Running a sink with a stream)
import { Effect, Sink, Stream } from "effect"
// Create a simple sink that always succeeds with a value
const sink: Sink.Sink<number> = Sink.succeed(42)
// Use the sink to consume a stream
const stream = Stream.make(1, 2, 3)
const program = Stream.run(stream, sink)
Effect.runPromise(program).then(console.log)
// Output: 42
Namespace containing types and interfaces for Sink variance and type relationships.
Sink<function (type parameter) A2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>A2, function (type parameter) In in <In, E, R>(self: Sink<A, In, L, E, R>): Sink<A2, In, L2, E2 | E, R2 | R>In, function (type parameter) L2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>L2, function (type parameter) E2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>E2 | function (type parameter) E in <In, E, R>(self: Sink<A, In, L, E, R>): Sink<A2, In, L2, E2 | E, R2 | R>E, function (type parameter) R2 in <A, L, A2, E2, R2, L2 = never>(f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): <In, E, R>(self: Sink<A, In, L, E, R>) => Sink<A2, In, L2, E2 | E, R2 | R>R2 | function (type parameter) R in <In, E, R>(self: Sink<A, In, L, E, R>): Sink<A2, In, L2, E2 | E, R2 | R>R>
<function (type parameter) A in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A, function (type parameter) In in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>In, function (type parameter) L in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L, function (type parameter) E in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E, function (type parameter) R in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R, function (type parameter) A2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A2, function (type parameter) E2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E2, function (type parameter) R2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R2, function (type parameter) L2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L2 = never>(
self: Sink<A, In, L, E, R>(parameter) self: {
transform: (upstream: Pull.Pull<NonEmptyReadonlyArray<In>, never, void>, scope: Scope.Scope) => Effect.Effect<End<A, L>, E, 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; <…;
}
self: interface Sink<out A, in In = unknown, out L = never, out E = never, out R = never>A Sink<A, In, L, E, R> is used to consume elements produced by a Stream.
You can think of a sink as a function that will consume a variable amount of
In elements (could be 0, 1, or many), might fail with an error of type E,
and will eventually yield a value of type A together with a remainder of
type L (i.e. any leftovers).
Example (Running a sink with a stream)
import { Effect, Sink, Stream } from "effect"
// Create a simple sink that always succeeds with a value
const sink: Sink.Sink<number> = Sink.succeed(42)
// Use the sink to consume a stream
const stream = Stream.make(1, 2, 3)
const program = Stream.run(stream, sink)
Effect.runPromise(program).then(console.log)
// Output: 42
Namespace containing types and interfaces for Sink variance and type relationships.
Sink<function (type parameter) A in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A, function (type parameter) In in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>In, function (type parameter) L in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L, function (type parameter) E in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E, function (type parameter) R in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R>,
f: (
end: End<A, L>
) => Effect.Effect<End<A2, L2>, E2, R2>
f: (end: End<A, L>(parameter) end: {
0: A;
1: readonly [L, ...L[]] | undefined;
length: 2 | 1;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<A | readonly [L, ...L[]] | undefined>>): Array<A | readonly [L, ...L[]] | undefined>; (...items: Array<A | readonly [L, ...L[]] | ConcatArray<A | readonly [L, ...L[]] | undefined> | undefined>): Array<A | rea…;
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<A | readonly [L, ...L[]] | undefined>;
indexOf: (searchElement: A | readonly [L, ...L[]] | undefined, fromIndex?: number) => number;
lastIndexOf: (searchElement: A | readonly [L, ...L[]] | undefined, fromIndex?: number) => number;
every: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: A | readonly [L, ...L[]] | unde…;
some: (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => void, thisArg?: any) => void;
map: (callbackfn: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): Array<S>; (predicate: (value: A | readonly [L, ...L[]] | undefined, index…;
reduce: { (callbackfn: (previousValue: A | readonly [L, ...L[]] | undefined, currentValue: A | readonly [L, ...L[]] | undefined, currentIndex: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => A | readonly [L, ...L[]] | undefi…;
reduceRight: { (callbackfn: (previousValue: A | readonly [L, ...L[]] | undefined, currentValue: A | readonly [L, ...L[]] | undefined, currentIndex: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => A | readonly [L, ...L[]] | undefi…;
find: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, obj: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A | readonly [L, ...L[]] | undefined, in…;
findIndex: (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, obj: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, A | readonly [L, ...L[]] | undefined]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<A | readonly [L, ...L[]] | undefined>;
includes: (searchElement: A | readonly [L, ...L[]] | undefined, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: A | readonly [L, ...L[]] | undefined, index: number, array: Array<A | readonly [L, ...L[]] | undefined>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => A | readonly [L, ...L[]] | undefined;
findLast: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A | readonly [L, ...L[]] | undefined, …;
findLastIndex: (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => unknown, thisArg?: any) => number;
toReversed: () => Array<A | readonly [L, ...L[]] | undefined>;
toSorted: (compareFn?: ((a: A | readonly [L, ...L[]] | undefined, b: A | readonly [L, ...L[]] | undefined) => number) | undefined) => Array<A | readonly [L, ...L[]] | undefined>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<A | readonly [L, ...L[]] | undefined>): Array<A | readonly [L, ...L[]] | undefined>; (start: number, deleteCount?: number): Array<A | readonly [L, ...L[]] | undefined> };
with: (index: number, value: A | readonly [L, ...L[]] | undefined) => Array<A | readonly [L, ...L[]] | undefined>;
}
end: type End<A, L = never> = readonly [
value: A,
leftover?: readonly [L, ...L[]] | undefined
]
Tuple returned when a Sink finishes.
Details
The first element is the sink result. The optional second element contains a
non-empty array of leftover input that was pulled but not consumed.
End<function (type parameter) A in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A, function (type parameter) L in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L>) => import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<type End<A, L = never> = readonly [
value: A,
leftover?: readonly [L, ...L[]] | undefined
]
Tuple returned when a Sink finishes.
Details
The first element is the sink result. The optional second element contains a
non-empty array of leftover input that was pulled but not consumed.
End<function (type parameter) A2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A2, function (type parameter) L2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L2>, function (type parameter) E2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E2, function (type parameter) R2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R2>
): interface Sink<out A, in In = unknown, out L = never, out E = never, out R = never>A Sink<A, In, L, E, R> is used to consume elements produced by a Stream.
You can think of a sink as a function that will consume a variable amount of
In elements (could be 0, 1, or many), might fail with an error of type E,
and will eventually yield a value of type A together with a remainder of
type L (i.e. any leftovers).
Example (Running a sink with a stream)
import { Effect, Sink, Stream } from "effect"
// Create a simple sink that always succeeds with a value
const sink: Sink.Sink<number> = Sink.succeed(42)
// Use the sink to consume a stream
const stream = Stream.make(1, 2, 3)
const program = Stream.run(stream, sink)
Effect.runPromise(program).then(console.log)
// Output: 42
Namespace containing types and interfaces for Sink variance and type relationships.
Sink<function (type parameter) A2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A2, function (type parameter) In in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>In, function (type parameter) L2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L2, function (type parameter) E in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E | function (type parameter) E2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E2, function (type parameter) R in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R | function (type parameter) R2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R2>
} = dual<(...args: Array<any>) => any, <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>) => Sink<A2, In, L2, E | E2, R | R2>>(arity: 2, body: <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>) => Sink<A2, In, L2, E | E2, R | R2>): ((...args: Array<any>) => any) & (<A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>) => Sink<A2, In, L2, E | E2, R | R2>) (+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) A in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A, function (type parameter) In in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>In, function (type parameter) L in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L, function (type parameter) E in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E, function (type parameter) R in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R, function (type parameter) A2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A2, function (type parameter) E2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E2, function (type parameter) R2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R2, function (type parameter) L2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L2 = never>(
self: Sink<A, In, L, E, R>(parameter) self: {
transform: (upstream: Pull.Pull<NonEmptyReadonlyArray<In>, never, void>, scope: Scope.Scope) => Effect.Effect<End<A, L>, E, 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; <…;
}
self: interface Sink<out A, in In = unknown, out L = never, out E = never, out R = never>A Sink<A, In, L, E, R> is used to consume elements produced by a Stream.
You can think of a sink as a function that will consume a variable amount of
In elements (could be 0, 1, or many), might fail with an error of type E,
and will eventually yield a value of type A together with a remainder of
type L (i.e. any leftovers).
Example (Running a sink with a stream)
import { Effect, Sink, Stream } from "effect"
// Create a simple sink that always succeeds with a value
const sink: Sink.Sink<number> = Sink.succeed(42)
// Use the sink to consume a stream
const stream = Stream.make(1, 2, 3)
const program = Stream.run(stream, sink)
Effect.runPromise(program).then(console.log)
// Output: 42
Namespace containing types and interfaces for Sink variance and type relationships.
Sink<function (type parameter) A in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A, function (type parameter) In in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>In, function (type parameter) L in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L, function (type parameter) E in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E, function (type parameter) R in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R>,
f: (
end: End<A, L>
) => Effect.Effect<End<A2, L2>, E2, R2>
f: (end: End<A, L>(parameter) end: {
0: A;
1: readonly [L, ...L[]] | undefined;
length: 2 | 1;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<A | readonly [L, ...L[]] | undefined>>): Array<A | readonly [L, ...L[]] | undefined>; (...items: Array<A | readonly [L, ...L[]] | ConcatArray<A | readonly [L, ...L[]] | undefined> | undefined>): Array<A | rea…;
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<A | readonly [L, ...L[]] | undefined>;
indexOf: (searchElement: A | readonly [L, ...L[]] | undefined, fromIndex?: number) => number;
lastIndexOf: (searchElement: A | readonly [L, ...L[]] | undefined, fromIndex?: number) => number;
every: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: A | readonly [L, ...L[]] | unde…;
some: (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => void, thisArg?: any) => void;
map: (callbackfn: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): Array<S>; (predicate: (value: A | readonly [L, ...L[]] | undefined, index…;
reduce: { (callbackfn: (previousValue: A | readonly [L, ...L[]] | undefined, currentValue: A | readonly [L, ...L[]] | undefined, currentIndex: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => A | readonly [L, ...L[]] | undefi…;
reduceRight: { (callbackfn: (previousValue: A | readonly [L, ...L[]] | undefined, currentValue: A | readonly [L, ...L[]] | undefined, currentIndex: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => A | readonly [L, ...L[]] | undefi…;
find: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, obj: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A | readonly [L, ...L[]] | undefined, in…;
findIndex: (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, obj: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, A | readonly [L, ...L[]] | undefined]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<A | readonly [L, ...L[]] | undefined>;
includes: (searchElement: A | readonly [L, ...L[]] | undefined, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: A | readonly [L, ...L[]] | undefined, index: number, array: Array<A | readonly [L, ...L[]] | undefined>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => A | readonly [L, ...L[]] | undefined;
findLast: { (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => value is S, thisArg?: any): S | undefined; (predicate: (value: A | readonly [L, ...L[]] | undefined, …;
findLastIndex: (predicate: (value: A | readonly [L, ...L[]] | undefined, index: number, array: ReadonlyArray<A | readonly [L, ...L[]] | undefined>) => unknown, thisArg?: any) => number;
toReversed: () => Array<A | readonly [L, ...L[]] | undefined>;
toSorted: (compareFn?: ((a: A | readonly [L, ...L[]] | undefined, b: A | readonly [L, ...L[]] | undefined) => number) | undefined) => Array<A | readonly [L, ...L[]] | undefined>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<A | readonly [L, ...L[]] | undefined>): Array<A | readonly [L, ...L[]] | undefined>; (start: number, deleteCount?: number): Array<A | readonly [L, ...L[]] | undefined> };
with: (index: number, value: A | readonly [L, ...L[]] | undefined) => Array<A | readonly [L, ...L[]] | undefined>;
}
end: type End<A, L = never> = readonly [
value: A,
leftover?: readonly [L, ...L[]] | undefined
]
Tuple returned when a Sink finishes.
Details
The first element is the sink result. The optional second element contains a
non-empty array of leftover input that was pulled but not consumed.
End<function (type parameter) A in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A, function (type parameter) L in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L>) => import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<type End<A, L = never> = readonly [
value: A,
leftover?: readonly [L, ...L[]] | undefined
]
Tuple returned when a Sink finishes.
Details
The first element is the sink result. The optional second element contains a
non-empty array of leftover input that was pulled but not consumed.
End<function (type parameter) A2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A2, function (type parameter) L2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L2>, function (type parameter) E2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E2, function (type parameter) R2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R2>
): interface Sink<out A, in In = unknown, out L = never, out E = never, out R = never>A Sink<A, In, L, E, R> is used to consume elements produced by a Stream.
You can think of a sink as a function that will consume a variable amount of
In elements (could be 0, 1, or many), might fail with an error of type E,
and will eventually yield a value of type A together with a remainder of
type L (i.e. any leftovers).
Example (Running a sink with a stream)
import { Effect, Sink, Stream } from "effect"
// Create a simple sink that always succeeds with a value
const sink: Sink.Sink<number> = Sink.succeed(42)
// Use the sink to consume a stream
const stream = Stream.make(1, 2, 3)
const program = Stream.run(stream, sink)
Effect.runPromise(program).then(console.log)
// Output: 42
Namespace containing types and interfaces for Sink variance and type relationships.
Sink<function (type parameter) A2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>A2, function (type parameter) In in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>In, function (type parameter) L2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>L2, function (type parameter) E in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E | function (type parameter) E2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>E2, function (type parameter) R in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R | function (type parameter) R2 in <A, In, L, E, R, A2, E2, R2, L2 = never>(self: Sink<A, In, L, E, R>, f: (end: End<A, L>) => Effect.Effect<End<A2, L2>, E2, R2>): Sink<A2, In, L2, E | E2, R | R2>R2> => const transformEffect: <
A,
In,
L,
E,
R,
A2,
E2,
R2,
L2 = never
>(
self: Sink<A, In, L, E, R>,
f: (
effect: Effect.Effect<End<A, L>, E, R>
) => Effect.Effect<End<A2, L2>, E2, R2>
) => Sink<A2, In, L2, E2, R2>
transformEffect(self: Sink<A, In, L, E, R>(parameter) self: {
transform: (upstream: Pull.Pull<NonEmptyReadonlyArray<In>, never, void>, scope: Scope.Scope) => Effect.Effect<End<A, L>, E, 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; <…;
}
self, import EffectEffect.const flatMap: {
<A, B, E1, R1>(
f: (a: A) => Effect<B, E1, R1>
): <E, R>(
self: Effect<A, E, R>
) => Effect<B, E1 | E, R1 | R>
<A, E, R, B, E1, R1>(
self: Effect<A, E, R>,
f: (a: A) => Effect<B, E1, R1>
): Effect<B, E | E1, R | R1>
}
flatMap(f: (
end: End<A, L>
) => Effect.Effect<End<A2, L2>, E2, R2>
f)))