Package: effect
Module: Types
Function-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
}
See
Contravariant.TypeCovariantInvariantSignature
type Contravariant<A> = (_: A) => void
Since v2.0.0