Ghostbuster: A tool for simplifying and converting GADTs

0Citations
Citations of this article
14Readers
Mendeley users who have this article in their library.

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.

Author supplied keywords

Cite

CITATION STYLE

APA

McDonell, T. L., Zakian, T. A. K., Cimini, M., & Newton, R. R. (2016). Ghostbuster: A tool for simplifying and converting GADTs. ACM SIGPLAN Notices, 51(9), 338–350. https://doi.org/10.1145/2951913.2951914

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free