Type Parameter Power-Up! Variance, Bounds, and Inference

May 16, 2018



Adding type parameters to classes is a powerful way to reuse code in Scala. By leveraging variance, type bounds, and higher-kinded types we can add further control and power to this reuse. We will learn how to use variance and type bounds to refine a type, how these types are inferred, and how higher-kinded types and type bounds combine with implicit resolution to give rise to the typeclass pattern, which helps bridge the gap between Scala's object-oriented and functional programming sides. We will also see how these features are evolving in future versions of Scala and Dotty. Required knowledge This talk assumes attendees have some exposure to type parameters and parameter inference, but will provide a brief review of this material. Learning objectives Attendees will learn how and when to apply variance and type bounds to their data structures to achieve better reuse. They will learn how to interpret and address compiler errors related to variance and type parameter inference. I've been coding in Java since the early days of the language, and in Scala for the last 5 years. My main areas of focus are in microservices and reactive approaches. I am always looking for Scala and general functional programming techniques help to achieve expressive, reusable code that is easy to understand and pleasant to work on. As our organization is a polyglot development environment, I'd also love to talk to you about adopting and evangelizing Scala within a receptive organization.



About Scala Days

Scala Days brings together developers from all corners of the world to share their experiences and new ideas around creating applications with Scala and related technologies, like Spark, Kafka, and Akka. Scala Days provides a unique opportunity for Scala users to interact with the contributors to the language and related technologies and connect with fellow developers.

Store presentation

Should this presentation be stored for 1000 years?

How do we store presentations

Total of 0 viewers voted for saving the presentation to eternal vault which is 0.0%


Recommended Videos

Presentations on similar topic, category or speaker