Scala Type Classes. What are they useful for?
In this talk, we will explore the problems of subtyping polymorphism in OOP, such as code coupling, compile vs. runtime function dispatch and non type safety.
Then, we will focus on alternatives like parametric and ad-hoc polymorphism, which address the problem of method overloading in OOP.
In order to understand why Type Classes can be useful, we will shorty look at their origination point, like Haskell language, as well similar idea of Type Classes in Rust (Traits). We will go through the Type Class implementation in Scala and see that ad hoc polymorphism has much more benefits and perhaps should be used by default in the language like Scala.
Although type classes are used quite often in Scala code, you can’t really recognise them, when you meet them for the first time. The problem is that type classes in Scala are not a part of the language and only manifest as a programming idiom, which consist of a couple of ingredients which form this pattern.
- 18:30 - 20:30
- Conference / Event
- Rhein-Main Scala Enthusiasts April 2019
- INNOQ, Büro Offenbach, Offenbach