A Google TechTalk, July 22, 2016, presented by Andres Löh ABSTRACT: Many Haskell functions can be defined for a large class of datatypes in a systematic way. Examples include structural equality and comparisons, all kind of (de)serialization functions (plain text, JSON, binary, etc.), traversal and access functions such as lenses and their various variants, functions for querying and updating databases and many more. For some built-in type classes, Haskell offers the "deriving" construct, but GHC also has a "generics" feature that allows users to define their own derivable classes, without having to resort to Template Haskell. In this talk, I'm going to introduce "generics-sop", a library that supports such datatype-generic programming by means of a number of powerful, higher-order combinators that can be reused and composed in several ways. This approach makes use of several type-system extensions available for GHC, such as GADTs (in particular, for heterogeneous lists), data kinds, kind polymorphism, constraint kinds, and rank-n polymorphism. We will start from examples and see how we can define a few generic functions using generics-sop and then, as far as time permits, look more closely at how it all works. https://wiki.haskell.org/ZuriHac2016
Get notified about new features and conference additions.