Write a Blog >>
ICFP 2018
Sun 23 - Sat 29 September 2018 St. Louis, Missouri, United States
Sun 23 Sep 2018 11:10 - 11:35 at Illinois Central - GHC Chair(s): Ben Gamari

GHC.Generics has seen enormous success as a tool for writing datatype-generic programs in Haskell. But its scope is currently limited, as the API that GHC.Generics exposes is only suitable for working plain old abstract datatypes. That is, one cannot write sensible Generic instances for GADTs.

In this talk, we propose an extension to GHC.Generics which would bridge this gap. Our technique relies on three observations:

  • One can express any GADT in an equivalent form where all existential quantification is made explicit.
  • Using various GHC language extensions, one can construct generic representation types that model existential quantification at the type level.
  • Using the QuantifiedConstraints language extension, one can reason about existentially quantified types in class instances without needing to know what those types are ahead of time.

We will demonstrate this technique to generically derive instances for progressively more complex GADTs, and briefly discuss how our work could be simplified by future GHC extensions, such as dependent types.

Slides: Generalized Abstract GHC.Generics (gagg-no-nums.pdf)209KiB

Sun 23 Sep
Times are displayed in time zone: (GMT-05:00) Guadalajara, Mexico City, Monterrey change

10:20 - 12:00: HIW 2018 - GHC at Illinois Central
Chair(s): Ben GamariWell-Typed LLP
hiw-2018-papers10:20 - 10:45
Simon Peyton JonesMicrosoft, UK
File Attached
hiw-2018-papers10:45 - 11:10
Matthew PickeringUniversity of Bristol
Media Attached
hiw-2018-papers11:10 - 11:35
Ryan ScottIndiana University at Bloomington, USA
File Attached
hiw-2018-papers11:35 - 11:43
Chris SmithGoogle, USA
hiw-2018-papers11:43 - 11:51
File Attached
hiw-2018-papers11:51 - 12:00
Media Attached