Overview
Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore value classes in Scala with Lukas Rytz in this 36-minute conference talk. Delve into the main idea behind value classes, their representation implications, and various use cases. Learn about defining value classes, type hierarchy, extending traits, and boxing. Understand performance models, overloading restrictions, and feature interactions in the compiler. Discover how value classes interact with Java interfaces and consider future possibilities like multiple fields. Gain insights into extension methods, trait method calls, and the manifestation of value classes at bridges.
Syllabus
Intro
Value Classes in Scala
Agenda
Main Idea
Implications of this Representation
Some Use Cases
Example: Extension Method
Xprint:typer
Client Code
Defining Value Classes
Type Hierarchy
Extending Traits
Boxing
Trait Method Calls
Performance Model
Overloading Restrictions
Manifestation at Bridges class C[T](val x T) extends Anyval
Extending Java Interfaces
Option[T] value class?
Feature Interactions in the Compiler
Future: Multiple Fields
Taught by
Java