In The Brain of Andres Löh, Datatype-Generic Programming in Haskell

Event Info

Tue 9 Apr, 2013 from 6:30pm - 8:00pm
The Skills Matter eXchange
116-120 Goswell Road
Cost: free


Haskell's deriving construct is both wonderful and magical at the same time: it is wonderful, because with just a single line of code, you can obtain functionality such as(de)serialization, comparison and traversal functions for your newly defined datatype; it is magical because all of this happens behind the scenes, by code deeply built into the compiler.

But does it have to be magic? Since recently, the Glasgow Haskell Compiler (GHC) supports a feature that lets you define your own derivable functionality! And it is not difficult to use, either. All you have to do is to understand a little bit about how Haskell datatypes can be uniformly represented using a limited set of simple datatypes. Then you define a class plus instances for this limited set of types, and get all the rest for free.

So-called datatype-generic functions let you properly express your code in terms of specific, user-defined datatypes without paying a price: for your new datatypes, you can still use lots of pre-defined functionality, simply by deriving it.

In the talk, Andres will explain all about how datatype-generic programming in GHC works, and I will present several examples of its use, including examples of how it already is successfully being used in some prominent Haskell libraries.


***To find out more and to get registered visit:


Javascript is required to view this map.


Email / 02071839040