Deriving generic class instances for datatypes (Q7361093)
From MaRDI portal
!
This is the item page for this Wikibase entity, intended for internal use and editing purposes. Please use the normal view instead:
AFP entry Generic_Deriving
| Language | Label | Description | Also known as |
|---|---|---|---|
| default for all languages | No label defined |
||
| English | Deriving generic class instances for datatypes |
AFP entry Generic_Deriving |
Statements
6 November 2018
0 references
Jonas Rädle
0 references
Lars Hupel
0 references
Deriving generic class instances for datatypes (English)
0 references
We provide a framework for automatically deriving instances for generic type classes. Our approach is inspired by Haskell's generic-deriving package and Scala's shapeless library. In addition to generating the code for type class functions, we also attempt to automatically prove type class laws for these instances. As of now, however, some manual proofs are still required for recursive datatypes. Note: There are already articles in the AFP that provide automatic instantiation for a number of classes. Concretely, Deriving allows the automatic instantiation of comparators, linear orders, equality, and hashing. Show instantiates a Haskell-style show class. Our approach works for arbitrary classes (with some Isabelle/HOL overhead for each class), but a smaller set of datatypes.
0 references