Scrap more boilerplate

Ralf Laemmel and Simon Peyton Jones, You can find further accompanying examples, libraries, and links on the Scrap your Boilerplate home page.

Abstract

We extend the "scrap your boilerplate" style of generic programming in Haskell to accomplish an additional range of applications. This includes several forms of serialisation and de-serialisation, test-set generation, type validation, and type erasure. To this end, we provide a well-designed reflection API for datatypes and constructors, and we also provide more general means of extending generic functions for given monomorphic or polymorphic types. The presented approach is readily supported in the GHC implementation of Haskell.