interface / @typed/fx/Fx

Fx.Variance

Describes how an Fx varies in its value, error, and service channels.

Package version
2.0.0-beta.13
Category
models
Since
1.0.0
Member of
Fx

Import

import { Fx } from "@typed/fx/Fx";

Access Fx.Variance through the imported Fx export. Its declaration below describes the member.

Signatures

interface Variance<A, E, R> {
    readonly _A: Types.Covariant<A>;
    readonly _E: Types.Covariant<E>;
    readonly _R: Types.Covariant<R>;
}

Why

The phantom fields preserve Fx<A, E, R> relationships through TypeScript’s structural type system and power channel extraction without runtime sampling.

Ownership and lifetime

Variance markers are type-level metadata and retain no values or resources.

Property: _A

Covariant marker for emitted values.

Property: _A: Why

Preserves the A relationship without retaining an emitted value.

Property: _A: Ownership and lifetime

This phantom field starts no work and owns no resource.

Property: _E

Covariant marker for typed failures.

Property: _E: Why

Preserves the E relationship without manufacturing a failure.

Property: _E: Ownership and lifetime

This phantom field starts no work and owns no resource.

Property: _R

Covariant marker for required services.

Property: _R: Why

Preserves the R relationship without reading an Effect context.

Property: _R: Ownership and lifetime

This phantom field starts no work and owns no resource.

Examples

import type { Fx } from "@typed/fx/Fx"

type NumberFxVariance = Fx.Variance<number, never, never>

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source