A generic deriving mechanism for Haskell

José Pedro Magalhães, Atze Dijkstra, Johan T. Jeuring, Andres Löh · 2010

Haskell's deriving mechanism supports the automatic generation of instances for a number of functions. The Haskell 98 Report only specifies how to generate instances for the Eq, Ord, Enum, Bounded, Show, and Read classes. The description of how to generate instances is largely informal. The generation of instances imposes restrictions on the shape of datatypes, depending on the particular class to derive. As a consequence, the portability of instances across different compilers is not guaranteed.

Read the paper · More papers on PaperTik