Lecture

Subtyping and Generics: Variance and Covariance

Description

This lecture covers the concepts of subtyping and generics, focusing on their interactions, type bounds, and variance. It explores the relationships between different types, such as IntSet, Empty, and NonEmpty, and how to define precise type bounds. The discussion extends to covariance, arrays, the Liskov Substitution Principle, and the definition of variance in Scala. The lecture also delves into the variance of function types, variance checks, and the implementation of covariant lists. Additionally, it addresses other collections like Vectors, arrays, strings, ranges, and various sequence operations. The session concludes with examples of combinatorial search, for-expressions, and prime number testing.

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.