anyNamespace containing type utilities for the Effect.all function, which handles
collecting multiple effects into various output structures.
export declare namespace All {
/**
* Alias for any `Effect` value accepted by `Effect.all`.
*
* @category utility types
* @since 2.0.0
*/
export type type All.EffectAny = Effect<any, any, any>Alias for any Effect value accepted by Effect.all.
EffectAny = 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<any, any, any>
/**
* Computes the return type for `Effect.all` when collecting an iterable.
*
* @category utility types
* @since 2.0.0
*/
export type type All.ReturnIterable<T extends Iterable<All.EffectAny>, Discard extends boolean, Mode extends boolean = false> = [T] extends [Iterable<Effect<infer A, infer E, infer R>>] ? Effect<Discard extends true ? void : (Mode extends true ? Result.Result<A, E> : A)[], Mode extends true ? never : E, R> : neverComputes the return type for Effect.all when collecting an iterable.
ReturnIterable<
function (type parameter) T in type All.ReturnIterable<T extends Iterable<All.EffectAny>, Discard extends boolean, Mode extends boolean = false>T extends interface Iterable<T, TReturn = any, TNext = any>Iterable<type All.EffectAny = Effect<any, any, any>Alias for any Effect value accepted by Effect.all.
EffectAny>,
function (type parameter) Discard in type All.ReturnIterable<T extends Iterable<All.EffectAny>, Discard extends boolean, Mode extends boolean = false>Discard extends boolean,
function (type parameter) Mode in type All.ReturnIterable<T extends Iterable<All.EffectAny>, Discard extends boolean, Mode extends boolean = false>Mode extends boolean = false
> = [function (type parameter) T in type All.ReturnIterable<T extends Iterable<All.EffectAny>, Discard extends boolean, Mode extends boolean = false>T] extends [interface Iterable<T, TReturn = any, TNext = any>Iterable<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<infer function (type parameter) AA, infer function (type parameter) EE, infer function (type parameter) RR>>] ? 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<
function (type parameter) Discard in type All.ReturnIterable<T extends Iterable<All.EffectAny>, Discard extends boolean, Mode extends boolean = false>Discard extends true ? void : interface Array<T>Array<function (type parameter) Mode in type All.ReturnIterable<T extends Iterable<All.EffectAny>, Discard extends boolean, Mode extends boolean = false>Mode extends true ? import ResultResult.type Result<A, E = never> = Result.Success<A, E> | Result.Failure<A, E>A value that is either Success<A, E> or Failure<A, E>.
When to use
Use when both success and failure should remain available as data and
Option would lose failure information.
Details
- Use
succeed
/
fail
to construct
- Use
match
to fold both branches
- Use
isSuccess
/
isFailure
to narrow the type
E defaults to never, so Result<number> means a result that cannot fail.
Example (Creating and matching a Result)
import { Result } from "effect"
const success = Result.succeed(42)
const failure = Result.fail("something went wrong")
const message = Result.match(success, {
onSuccess: (value) => `Success: ${value}`,
onFailure: (error) => `Error: ${error}`
})
console.log(message)
// Output: "Success: 42"
Namespace containing type-level utilities for extracting the inner types
of a Result.
Example (Extracting inner types)
import type { Result } from "effect"
type R = Result.Result<number, string>
// number
type A = Result.Result.Success<R>
// string
type E = Result.Result.Failure<R>
Result<function (type parameter) AA, function (type parameter) EE> : function (type parameter) AA>,
function (type parameter) Mode in type All.ReturnIterable<T extends Iterable<All.EffectAny>, Discard extends boolean, Mode extends boolean = false>Mode extends true ? never : function (type parameter) EE,
function (type parameter) RR
>
: never
/**
* Computes the return type for `Effect.all` when collecting a tuple.
*
* @category utility types
* @since 2.0.0
*/
export type type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false> = Effect<Discard extends true ? void : T[number] extends never ? [] : { -readonly [K in keyof T]: T[K] extends Effect<infer _A, infer _E, infer _R> ? Mode extends true ? Result.Result<_A, _E> : _A : never; }, Mode extends true ? never : T[number] extends never ? never : T[number] extends Effect<infer _A, infer _E, infer _R> ? _E : never, T[number] extends never ? never : T[number] extends Effect<infer _A, infer _E, infer _R> ? _R : never>Computes the return type for Effect.all when collecting a tuple.
ReturnTuple<
function (type parameter) T in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>T extends interface ReadonlyArray<T>ReadonlyArray<unknown>,
function (type parameter) Discard in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>Discard extends boolean,
function (type parameter) Mode in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>Mode extends boolean = false
> = 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<
function (type parameter) Discard in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>Discard extends true ? void
: function (type parameter) T in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>T[number] extends never ? []
: {
-readonly [function (type parameter) KK in keyof function (type parameter) T in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>T]: function (type parameter) T in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>T[function (type parameter) KK] extends 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<
infer function (type parameter) _A_A,
infer function (type parameter) _E_E,
infer function (type parameter) _R_R
> ? function (type parameter) Mode in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>Mode extends true ? import ResultResult.type Result<A, E = never> = Result.Success<A, E> | Result.Failure<A, E>A value that is either Success<A, E> or Failure<A, E>.
When to use
Use when both success and failure should remain available as data and
Option would lose failure information.
Details
- Use
succeed
/
fail
to construct
- Use
match
to fold both branches
- Use
isSuccess
/
isFailure
to narrow the type
E defaults to never, so Result<number> means a result that cannot fail.
Example (Creating and matching a Result)
import { Result } from "effect"
const success = Result.succeed(42)
const failure = Result.fail("something went wrong")
const message = Result.match(success, {
onSuccess: (value) => `Success: ${value}`,
onFailure: (error) => `Error: ${error}`
})
console.log(message)
// Output: "Success: 42"
Namespace containing type-level utilities for extracting the inner types
of a Result.
Example (Extracting inner types)
import type { Result } from "effect"
type R = Result.Result<number, string>
// number
type A = Result.Result.Success<R>
// string
type E = Result.Result.Failure<R>
Result<function (type parameter) _A_A, function (type parameter) _E_E> : function (type parameter) _A_A
: never
},
function (type parameter) Mode in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>Mode extends true ? never
: function (type parameter) T in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>T[number] extends never ? never
: function (type parameter) T in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>T[number] extends 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<infer function (type parameter) _A_A, infer function (type parameter) _E_E, infer function (type parameter) _R_R> ? function (type parameter) _E_E
: never,
function (type parameter) T in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>T[number] extends never ? never
: function (type parameter) T in type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false>T[number] extends 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<infer function (type parameter) _A_A, infer function (type parameter) _E_E, infer function (type parameter) _R_R> ? function (type parameter) _R_R
: never
> extends infer function (type parameter) XX ? function (type parameter) XX
: never
/**
* Computes the return type for `Effect.all` when collecting a record.
*
* @category utility types
* @since 2.0.0
*/
export type type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false> = [T] extends [Record<string, EffectAny>] ? Effect<Discard extends true ? void : { -readonly [K in keyof T]: [T[K]] extends [Effect<infer _A, infer _E, infer _R>] ? Mode extends true ? Result.Result<_A, _E> : _A : never; }, Mode extends true ? never : keyof T extends never ? never : T[keyof T] extends Effect<infer _A, infer _E, infer _R> ? _E : never, keyof T extends never ? never : T[keyof T] extends Effect<infer _A, infer _E, infer _R> ? _R : never> : neverComputes the return type for Effect.all when collecting a record.
ReturnObject<function (type parameter) T in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>T, function (type parameter) Discard in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>Discard extends boolean, function (type parameter) Mode in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>Mode extends boolean = false> = [function (type parameter) T in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>T] extends [
type Record<K extends keyof any, T> = {
[P in K]: T
}
Construct a type with a set of properties K of type T
Record<string, type All.EffectAny = Effect<any, any, any>Alias for any Effect value accepted by Effect.all.
EffectAny>
] ? 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<
function (type parameter) Discard in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>Discard extends true ? void
: {
-readonly [function (type parameter) KK in keyof function (type parameter) T in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>T]: [function (type parameter) T in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>T[function (type parameter) KK]] extends [
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<infer function (type parameter) _A_A, infer function (type parameter) _E_E, infer function (type parameter) _R_R>
] ? function (type parameter) Mode in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>Mode extends true ? import ResultResult.type Result<A, E = never> = Result.Success<A, E> | Result.Failure<A, E>A value that is either Success<A, E> or Failure<A, E>.
When to use
Use when both success and failure should remain available as data and
Option would lose failure information.
Details
- Use
succeed
/
fail
to construct
- Use
match
to fold both branches
- Use
isSuccess
/
isFailure
to narrow the type
E defaults to never, so Result<number> means a result that cannot fail.
Example (Creating and matching a Result)
import { Result } from "effect"
const success = Result.succeed(42)
const failure = Result.fail("something went wrong")
const message = Result.match(success, {
onSuccess: (value) => `Success: ${value}`,
onFailure: (error) => `Error: ${error}`
})
console.log(message)
// Output: "Success: 42"
Namespace containing type-level utilities for extracting the inner types
of a Result.
Example (Extracting inner types)
import type { Result } from "effect"
type R = Result.Result<number, string>
// number
type A = Result.Result.Success<R>
// string
type E = Result.Result.Failure<R>
Result<function (type parameter) _A_A, function (type parameter) _E_E> : function (type parameter) _A_A
: never
},
function (type parameter) Mode in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>Mode extends true ? never
: keyof function (type parameter) T in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>T extends never ? never
: function (type parameter) T in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>T[keyof function (type parameter) T in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>T] extends 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<infer function (type parameter) _A_A, infer function (type parameter) _E_E, infer function (type parameter) _R_R> ? function (type parameter) _E_E
: never,
keyof function (type parameter) T in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>T extends never ? never
: function (type parameter) T in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>T[keyof function (type parameter) T in type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false>T] extends 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<infer function (type parameter) _A_A, infer function (type parameter) _E_E, infer function (type parameter) _R_R> ? function (type parameter) _R_R
: never
>
: never
/**
* Detects whether `Effect.all` should discard collected values.
*
* @category utility types
* @since 2.0.0
*/
export type type All.IsDiscard<A> = [Extract<A, {
readonly discard: true;
}>] extends [never] ? false : true
Detects whether Effect.all should discard collected values.
IsDiscard<function (type parameter) A in type All.IsDiscard<A>A> = [type Extract<T, U> = T extends U
? T
: never
Extract from T those types that are assignable to U
Extract<function (type parameter) A in type All.IsDiscard<A>A, { readonly discard: truediscard: true }>] extends [
never
] ? false
: true
/**
* Detects whether `Effect.all` should collect results in `Result` mode.
*
* @category utility types
* @since 4.0.0
*/
export type type All.IsResult<A> = [Extract<A, {
readonly mode: "result";
}>] extends [never] ? false : true
Detects whether Effect.all should collect results in Result mode.
IsResult<function (type parameter) A in type All.IsResult<A>A> = [type Extract<T, U> = T extends U
? T
: never
Extract from T those types that are assignable to U
Extract<function (type parameter) A in type All.IsResult<A>A, { readonly mode: "result"mode: "result" }>] extends [never] ? false : true
/**
* Computes the return type for `Effect.all` from its input and options.
*
* @category utility types
* @since 2.0.0
*/
export type type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }> = [Arg] extends [readonly EffectAny[]] ? Effect<IsDiscard<O> extends true ? void : Arg[number] extends never ? [] : { -readonly [K in keyof Arg]: Arg[K] extends Effect<infer _A, infer _E, infer _R> ? IsResult<O> extends true ? Result.Result<_A, _E> : _A : never; }, IsResult<O> extends true ? never : Arg[number] extends never ? never : Arg[number] extends Effect<infer _A, infer _E, infer _R> ? _E : never, Arg[number] extends never ? never : Arg[number] extends Effect<...> ? _R : never> : [...] extends [...] ? ReturnIterable<...> : [...] extends [...] ? ReturnObject<...> : neverComputes the return type for Effect.all from its input and options.
Return<
function (type parameter) Arg in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>Arg extends interface Iterable<T, TReturn = any, TNext = any>Iterable<type All.EffectAny = Effect<any, any, any>Alias for any Effect value accepted by Effect.all.
EffectAny> | type Record<K extends keyof any, T> = {
[P in K]: T
}
Construct a type with a set of properties K of type T
Record<string, type All.EffectAny = Effect<any, any, any>Alias for any Effect value accepted by Effect.all.
EffectAny>,
function (type parameter) O in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>O extends {
readonly concurrency?: Concurrency | undefinedconcurrency?: type Concurrency = number | "unbounded" | "inherit"Describes the concurrency level for Effect operations that run multiple
effects.
When to use
Use to type options that control how many effects may run at the same time.
Details
number — run at most N effects concurrently.
"unbounded" — run all effects concurrently with no limit.
"inherit" — inherit the concurrency from the surrounding context.
Example (Setting concurrency values)
import type { Types } from "effect"
const sequential: Types.Concurrency = 1
const limited: Types.Concurrency = 5
const unbounded: Types.Concurrency = "unbounded"
const inherit: Types.Concurrency = "inherit"
Concurrency | undefined
readonly discard?: boolean | undefineddiscard?: boolean | undefined
readonly mode?: "result" | "default" | undefinedmode?: "default" | "result" | undefined
}
> = [function (type parameter) Arg in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>Arg] extends [interface ReadonlyArray<T>ReadonlyArray<type All.EffectAny = Effect<any, any, any>Alias for any Effect value accepted by Effect.all.
EffectAny>] ? type All.ReturnTuple<T extends ReadonlyArray<unknown>, Discard extends boolean, Mode extends boolean = false> = Effect<Discard extends true ? void : T[number] extends never ? [] : { -readonly [K in keyof T]: T[K] extends Effect<infer _A, infer _E, infer _R> ? Mode extends true ? Result.Result<_A, _E> : _A : never; }, Mode extends true ? never : T[number] extends never ? never : T[number] extends Effect<infer _A, infer _E, infer _R> ? _E : never, T[number] extends never ? never : T[number] extends Effect<infer _A, infer _E, infer _R> ? _R : never>Computes the return type for Effect.all when collecting a tuple.
ReturnTuple<function (type parameter) Arg in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>Arg, type All.IsDiscard<A> = [Extract<A, {
readonly discard: true;
}>] extends [never] ? false : true
Detects whether Effect.all should discard collected values.
IsDiscard<function (type parameter) O in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>O>, type All.IsResult<A> = [Extract<A, {
readonly mode: "result";
}>] extends [never] ? false : true
Detects whether Effect.all should collect results in Result mode.
IsResult<function (type parameter) O in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>O>>
: [function (type parameter) Arg in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>Arg] extends [interface Iterable<T, TReturn = any, TNext = any>Iterable<type All.EffectAny = Effect<any, any, any>Alias for any Effect value accepted by Effect.all.
EffectAny>] ? type All.ReturnIterable<T extends Iterable<All.EffectAny>, Discard extends boolean, Mode extends boolean = false> = [T] extends [Iterable<Effect<infer A, infer E, infer R>>] ? Effect<Discard extends true ? void : (Mode extends true ? Result.Result<A, E> : A)[], Mode extends true ? never : E, R> : neverComputes the return type for Effect.all when collecting an iterable.
ReturnIterable<function (type parameter) Arg in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>Arg, type All.IsDiscard<A> = [Extract<A, {
readonly discard: true;
}>] extends [never] ? false : true
Detects whether Effect.all should discard collected values.
IsDiscard<function (type parameter) O in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>O>, type All.IsResult<A> = [Extract<A, {
readonly mode: "result";
}>] extends [never] ? false : true
Detects whether Effect.all should collect results in Result mode.
IsResult<function (type parameter) O in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>O>>
: [function (type parameter) Arg in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>Arg] extends [type Record<K extends keyof any, T> = {
[P in K]: T
}
Construct a type with a set of properties K of type T
Record<string, type All.EffectAny = Effect<any, any, any>Alias for any Effect value accepted by Effect.all.
EffectAny>] ? type All.ReturnObject<T, Discard extends boolean, Mode extends boolean = false> = [T] extends [Record<string, EffectAny>] ? Effect<Discard extends true ? void : { -readonly [K in keyof T]: [T[K]] extends [Effect<infer _A, infer _E, infer _R>] ? Mode extends true ? Result.Result<_A, _E> : _A : never; }, Mode extends true ? never : keyof T extends never ? never : T[keyof T] extends Effect<infer _A, infer _E, infer _R> ? _E : never, keyof T extends never ? never : T[keyof T] extends Effect<infer _A, infer _E, infer _R> ? _R : never> : neverComputes the return type for Effect.all when collecting a record.
ReturnObject<function (type parameter) Arg in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>Arg, type All.IsDiscard<A> = [Extract<A, {
readonly discard: true;
}>] extends [never] ? false : true
Detects whether Effect.all should discard collected values.
IsDiscard<function (type parameter) O in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>O>, type All.IsResult<A> = [Extract<A, {
readonly mode: "result";
}>] extends [never] ? false : true
Detects whether Effect.all should collect results in Result mode.
IsResult<function (type parameter) O in type All.Return<Arg extends Iterable<All.EffectAny> | Record<string, All.EffectAny>, O extends { readonly concurrency?: Concurrency | undefined; readonly discard?: boolean | undefined; readonly mode?: "default" | "result" | undefined; }>O>>
: never
}