Document Type
Technical Report
Publication Title
University of Pennsylvania Department of Computer and Information Science Technical Report
Version
Final Published Version
Volume
MS-CIS-14-07
Publication Date
2014
Abstract
Generative type abstractions – present in Haskell, OCaml, and other languages – are useful concepts to help prevent programmer errors. They serve to create new types that are distinct at compile time but share a run-time representation with some base type. We present a new mechanism that allows for zero-cost conversions between generative type abstractions and their representations, even when such types are deeply nested. We prove type safety in the presence of these conversions and have implemented our work in GHC.
Citation
J. Breitner, R. A. Eisenberg, S. Peyton Jones, S. Weirich. Safe Zero-cost Coercions for Haskell (extended version). University of Pennsylvania Technical Report MS-CIS-14-07, 2014