Are you an EPFL student looking for a semester project?
Work with us on data science and visualisation projects, and deploy your project as an app on top of Graph Search.
This lecture delves into the concepts of subtyping and generics in Scala, exploring how they interact in the context of polymorphism. The instructor explains the relationship between bounds for type variables and the concept of variants, focusing on the most advanced concept of mixing generics and subtyping. The lecture also covers the importance of variance in understanding the interaction between subtyping and type parameters, using examples like arrays and lists to illustrate potential issues and solutions. Additionally, the instructor discusses the Liskoff substitution principle and how it applies to subtyping relationships, emphasizing the significance of precise type descriptions in modeling. The lecture concludes with a practical demonstration of using for expressions to express higher-order functions like map, flatMap, and filter.