
Today I Learned
TIL: Covariant vs Contravariant Types
When working with type systems in programming languages like TypeScript, Scala, Java, or even Python (via type hints), you'll encounter the concepts of covariance and contravariance. These terms describe how the subtype relationships of generic types behave when you substitute their type parameters. Understanding them can help you