Lecture

Variance: Definition and Typing Rules

Description

This lecture covers the concept of variance in Scala, explaining the relationships between covariant, contravariant, and nonvariant types. It delves into the typing rules for functions, showcasing how they are contravariant in argument types and covariant in result types. The instructor also discusses variance checks, highlighting the importance of proper combinations to avoid unsound operations. Additionally, the lecture explores the implementation of variance in lists, demonstrating how to make classes covariant and the use of lower bounds to ensure variance correctness.

About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.