Generic Programming in Scala - all that we must know !

By Afsal Thaj

Elevator Pitch

The talk is on Generic Programming in Scala, starting from basics, to shapeless, and all the way to concepts in scalaz-deriving. We will showcase an algorithm built to compute state of cloud infrastructure, and explain how important it is to know these concepts to make robust solutions.

Description

Generic Programming in Scala has always been an interesting topic. Dozens of libraries that we use in scala is based on the concepts that we will be covering in this talk.

Recently, we have had a chance to write a web application that tries to deploy a multi-tenanted infrastructure in cloud. We will share the success story of how quick and easy was it to implement the same with the backing of Generic Programming and FP concepts, and thereby produce an application that was bang on in the production environment with seriously no bugs. In short, we have got a resource differencing algorithm written in scala using automatic type class derivation. The application then performs a fast and robust refresh of resources in the cloud based on the declarative HOCCON based DSL written by the user.

I will cover the concepts in shapeless, share the logic of resource differencing algorithm, discuss the must-know concepts of scalaz-deriving and in fact discuss about how can we do this with macros in Scala directly. I will not forget to mention about Generic Programming coming up in Scala 3 while discussing about the pros and cons of all these approaches.

The talk is intended to motivate the FP lovers to look much more deeper into the power of Scala, and enable developers to easily uncover the possibility of building much more robust libraries for their clients.