Hostname: page-component-74656f9884-c52kr Total loading time: 0 Render date: 2026-11-08T07:44:18.113Z Has data issue: false hasContentIssue false

Safe zero-cost coercions for Haskell

Published online by Cambridge University Press:  28 July 2016

JOACHIM BREITNER
Affiliation:
Karlsruhe Institute of Technology, Karlsruhe, Germany (e-mail: breitner@kit.edu)
RICHARD A. EISENBERG
Affiliation:
University of Pennsylvania, Philadelphia, Pennsylvania, USA (e-mail: eir@cis.upenn.edu)
SIMON PEYTON JONES
Affiliation:
Microsoft Research, Cambridge, United Kingdom (e-mail: simonpj@microsoft.com)
STEPHANIE WEIRICH
Affiliation:
University of Pennsylvania, Philadelphia, Pennsylvania, USA (e-mail: sweirich@cis.upenn.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

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.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2016 
Submit a response

Discussions

No Discussions have been published for this article.