zio.blocks.typeid.Variance
See theVariance companion object
Represents the variance of a type parameter.
Variance determines how subtyping of type arguments affects subtyping of parameterized types:
- Covariant (+A): If
Dog <: Animal, then List[Dog] <: List[Animal]
- Contravariant (-A): If
Dog <: Animal, then Handler[Animal] <: Handler[Dog]
- Invariant (A): No subtyping relationship between
Box[Dog] and Box[Animal]
Attributes
- Companion
-
object
- Source
-
Variance.scala
- Graph
-
- Supertypes
-
trait Matchable
class Any
- Known subtypes
-
Members list
Combines two variances. Used when a type parameter appears in a nested position.
Combines two variances. Used when a type parameter appears in a nested position.
Attributes
- Source
-
Variance.scala
Flips the variance (covariant contravariant, invariant stays).
Flips the variance (covariant contravariant, invariant stays).
Attributes
- Source
-
Variance.scala
Returns true if this is contravariant.
Returns true if this is contravariant.
Attributes
- Source
-
Variance.scala
Returns true if this is covariant.
Returns true if this is invariant.
Returns the Scala syntax for this variance annotation.
Returns the Scala syntax for this variance annotation.
Attributes
- Source
-
Variance.scala