Singleton Types Here Singleton Types There Singleton Types Everywhere

被引:9
|
作者
Monnier, Stefan [1 ]
Haguenauer, David [1 ]
机构
[1] Univ Montreal, Montreal, PQ H3C 3J7, Canada
来源
PLPV'10: PROCEEDINGS OF THE 2010 ACM SIGPLAN WORKSHOP ON PROGRAMMING LANGUAGES MEETS PROGRAM VERIFICATION | 2010年
关键词
Dependent types; singleton types; certified compilation; POLYMORPHISM; ERASURE;
D O I
10.1145/1707790.1707792
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Singleton types are often considered a poor man's substitute for dependent types. But their generalization in the form of GADTs has found quite a following. The main advantage of singleton types and GADTs is to preserve the so-called phase distinction, which seems to be so important to make use of the usual compilation techniques. Of course, they considerably restrict the programmers, which often leads them to duplicate code at both the term and type levels, so as to reflect at the type level what happens at the term level, in order to be able to reason about it. In this article, we show how to automate such a duplication while eliminating the problematic dependencies. More specifically, we show how to compile the Calculus of Constructions into lambda(H), a non-dependently-typed language, while still preserving all the typing information. Since lambda(H) has been shown to be amenable to type preserving CPS and closure conversion, it shows a way to preserve types when doing code extraction and more generally when using all the common compiler techniques.
引用
收藏
页码:1 / 7
页数:7
相关论文
共 50 条