Type-Level Computations in Scala

8th December 2014 in London at Business Design Centre

There are 54 other SkillsCasts available from Scala eXchange 2014

Skillscast coming soon.

Scala has a powerful type system that allows many properties of a program to be verified at compile-time. Do you still think of types as Int, String and Object? Types like ""Fold[Nat, ({ type L[X <: HList, Z <: Nat] = Succ[Z] })#L, Nat._0]"" are only a small step away. You can have the compiler perform computations on natural numbers, enforce the sizes of collections and always get the correct element type out of a heterogeneous list. All of that happens at compile-time without impacting the runtime performance of your code.

This introduction to type-level programming will show you a step-by-step translation from value-level computations to type-level computations. You will learn what mechanisms you can use to structure your code and what limits Scala puts on the expressiveness of types.

The talk is based on my type-level experiments in github.


Thanks to our sponsors

Type-Level Computations in Scala

Stefan Zeiger

Stefan Zeiger is a member of the Scala compiler team at Lightbend. He was the tech lead for Slick since 2011 and the creator of its predecessor, ScalaQuery. He has been a user of Java and the JVM platform professionally since 1996, working on a diverse range of projects from web servers to GUI frameworks and programming language design, and moving on from Java to Scala since 2008. He is a frequent speaker at ScalaDays and other conferences.