Document Type
Article
Publication Title
Journal of Functional Programming
Version
Final Published Version
Volume
26
Publication Date
2016
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.
Publisher's Statement
© 2016 Cambridge University Press. This is the author's final manuscript. The publisher's version can be found here: http://dx.doi.org/10.1017/S0956796816000150
DOI
http://dx.doi.org/10.1017/S0956796816000150
Citation
Joachim Breitner, Richard A. Eisenberg, Simon Peyton Jones, and Stephanie Weirich, "Safe zero-cost coercions for Haskell." Journal of Functional Programming 26 (2016), e15, 79 pages.