Title
Ghostbuster: a tool for simplifying and converting GADTs.
Abstract
Generalized Algebraic Dataypes, or simply GADTs, can encode non-trivial properties in the types of the constructors. Once such properties are encoded in a datatype, however, all code manipulating that datatype must provide proof that it maintains these properties in order to typecheck. In this paper, we take a step towards gradualizing these obligations. We introduce a tool, Ghostbuster, that produces simplified versions of GADTs which elide selected type parameters, thereby weakening the guarantees of the simplified datatype in exchange for reducing the obligations necessary to manipulate it. Like ornaments, these simplified datatypes preserve the recursive structure of the original, but unlike ornaments we focus on information-preserving bidirectional transformations. Ghostbuster generates type-safe conversion functions between the original and simplified datatypes, which we prove are the identity function when composed. We evaluate a prototype tool for Haskell against thousands of GADTs found on the Hackage package database, generating simpler Haskell'98 datatypes and round-trip conversion functions between the two.
Year
DOI
Venue
2016
10.1145/2951913.2951914
ICFP
Field
DocType
Citations 
Identity function,ENCODE,Programming language,Algebraic number,Computer science,Theoretical computer science,Haskell,Ornaments,Recursion
Conference
0
PageRank 
References 
Authors
0.34
21
4
Name
Order
Citations
PageRank
Trevor L. McDonell11436.67
Timothy A. K. Zakian221.38
Matteo Cimini3647.02
Ryan Newton480270.80