Package: effect
Module: Fiber
Variance encoding for the Fiber type, specifying covariance in both the
success type A and the error type E.
When to use
Use to carry the success and error type parameters for Fiber in Effect’s
type machinery.
Example (Upcasting fibers safely)
import type { Fiber } from "effect"
// Variance allows safe subtyping
declare const fiber: Fiber.Fiber<number, Error>
const upcast: Fiber.Fiber<unknown, unknown> = fiber
Signature
export interface Variance<out A, out E = never> {
readonly _A: Covariant<A>
readonly _E: Covariant<E>
}
Since v2.0.0