Variance<ROut, E, RIn>The variance interface for Layer type parameters.
export interface interface Variance<in ROut, out E, out RIn>The variance interface for Layer type parameters.
Variance<in function (type parameter) ROut in Variance<in ROut, out E, out RIn>ROut, out function (type parameter) E in Variance<in ROut, out E, out RIn>E, out function (type parameter) RIn in Variance<in ROut, out E, out RIn>RIn> {
readonly [const TypeId: "~effect/Layer"TypeId]: {
readonly _ROut: Types.Contravariant<ROut>_ROut: import TypesTypes.type Contravariant<A> = (_: A) => voidFunction-type alias encoding contravariant variance for a phantom type
parameter.
When to use
Use as a phantom field type to make a type parameter contravariant in input
position.
Details
Contravariant<A> is assignable to Contravariant<B> when B extends A,
following the supertype direction.
Example (Defining a contravariant phantom type)
import type { Types } from "effect"
interface Consumer<T> {
readonly _phantom: Types.Contravariant<T>
readonly accept: (value: T) => void
}
Namespace for
Contravariant
-related utilities.
When to use
Use when referring to type-level helpers nested under Contravariant.
Contravariant<function (type parameter) ROut in Variance<in ROut, out E, out RIn>ROut>
readonly _E: Types.Covariant<E>_E: import TypesTypes.type Covariant<A> = (_: never) => AFunction-type alias encoding covariant variance for a phantom type
parameter.
When to use
Use as a phantom field type to make a type parameter covariant in output
position.
Details
Covariant<A> is assignable to Covariant<B> when A extends B, following
the subtype direction.
Example (Defining a covariant phantom type)
import type { Types } from "effect"
interface Producer<T> {
readonly _phantom: Types.Covariant<T>
readonly get: () => T
}
Namespace for
Covariant
-related utilities.
When to use
Use when referring to type-level helpers nested under Covariant.
Covariant<function (type parameter) E in Variance<in ROut, out E, out RIn>E>
readonly _RIn: Types.Covariant<RIn>_RIn: import TypesTypes.type Covariant<A> = (_: never) => AFunction-type alias encoding covariant variance for a phantom type
parameter.
When to use
Use as a phantom field type to make a type parameter covariant in output
position.
Details
Covariant<A> is assignable to Covariant<B> when A extends B, following
the subtype direction.
Example (Defining a covariant phantom type)
import type { Types } from "effect"
interface Producer<T> {
readonly _phantom: Types.Covariant<T>
readonly get: () => T
}
Namespace for
Covariant
-related utilities.
When to use
Use when referring to type-level helpers nested under Covariant.
Covariant<function (type parameter) RIn in Variance<in ROut, out E, out RIn>RIn>
}
}