All you don't need to know about typeclasses

8th December 2014 in London at Business Design Centre

There are 54 other SkillsCasts available from Scala eXchange 2014

Please log in to watch this conference skillscast.

499422699 640

Scala syntax is succinct, clean and easy to read, however some of the library signatures that support this are more complicated than one might expect. Type-classes use sophisticated signatures to enable clean client code. This talk is aimed at novice or intermediate Scala developers wanting to learn more about this powerful technique. We will explore what they are and how they can simplify code. We introduce the concept by examining some of the Scala collections’ library method signatures. In particular we will be looking at Ordering[T] and CanBuildFrom[-From, -Elem, +To].

Then we will explore how to solve the common problem of custom data serialisation. Initially we will present some commonly adopted approaches including the Adapter Pattern, showing their pitfalls. Then, we will show how type-classes simplify the design and result in better extensibility and and API usability.

Finally we will discover how users don’t need to understand type-classes to make use of these libraries.


Thanks to our sponsors

All you don't need to know about typeclasses

Julien Sirocchi

Julien is a Software Engineer at Workday who has fallen in love with Scala back in 2010. Like many other computer engineers who have started their career around the beginning of the new millennium, he comes from a Java background but has quickly embraced the modular nature of Scala and he now tends to consider himself an FP advocate.