arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1905.13706cs.PL
收藏

Haskell中依赖类型的作用(扩展版)

A Role for Dependent Types in Haskell (Extended version)

Stephanie Weirich, Pritam Choudhury, Antoine Voizard, Richard A. Eisenberg

摘要:

现代的Haskell支持零成本转换器,这是一种机制,共享相同运行时表示的类型可以在它们之间自由转换。为了确保这种转换是安全和可取的,此功能依赖于一种角色机制来禁止无效的转换。在这项工作中,我们将展示如何整合角色与依赖类型系统,并证明,使用Coq证明助手,所产生的系统是健全的。我们将这项工作设计为向Glasgow Haskell编译器添加依赖类型的基础,但我们也希望它对其他依赖类型语言的设计者有用,他们可能希望采用Haskell的安全编译器特性。

英文摘要:

Modern Haskell supports zero-cost coercions, a mechanism where types that share the same run-time representation may be freely converted between. To make sure such conversions are safe and desirable, this feature relies on a mechanism of roles to prohibit invalid coercions. In this work, we show how to integrate roles with dependent type systems and prove, using the Coq proof assistant, that the resulting system is sound. We have designed this work as a foundation for the addition of dependent types to the Glasgow Haskell Compiler, but we also expect that it will be of use to designers of other dependently-typed languages who might want to adopt Haskell's safe coercions feature.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑