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

Haskell中的依赖类型:理论与实践

Dependent Types in Haskell: Theory and Practice

Richard A. Eisenberg

摘要:

在Glasgow Haskell编译器(GHC)中实现的Haskell已经添加了新的类型级编程特性一段时间了。这些特性中的许多--主要是:广义代数数据库(GADT)、类型族、种类多态性和提升数据库--已经将Haskell带到了依赖类型的门槛。许多依赖类型的程序现在甚至可以被编码,但是构造过程通常是痛苦的。在这篇论文中,我描述了依赖Haskell,它通过对今天的Haskell的向后兼容扩展来支持完全依赖类型。这项工作的一个重要贡献是在GHC中实现了Dependent Haskell的一部分,其余部分将遵循。我实现的特性已经在GHC 8.0中发布了。本论文包含了依赖Haskell代码的几个实际例子,依赖Haskell和今天的Haskell之间的差异,一个新的类型安全的依赖类型的类演算(称为Pico)适合用作编译依赖Haskell的中间语言,和一个类型推断和细化算法,烘烤,翻译依赖Haskell类型正确的Pico之间的完整描述。

英文摘要:

Haskell, as implemented in the Glasgow Haskell Compiler (GHC), has been adding new type-level programming features for some time. Many of these features---chiefly: generalized algebraic datatypes (GADTs), type families, kind polymorphism, and promoted datatypes---have brought Haskell to the doorstep of dependent types. Many dependently typed programs can even currently be encoded, but often the constructions are painful. In this dissertation, I describe Dependent Haskell, which supports full dependent types via a backward-compatible extension to today's Haskell. An important contribution of this work is an implementation, in GHC, of a portion of Dependent Haskell, with the rest to follow. The features I have implemented are already released, in GHC 8.0. This dissertation contains several practical examples of Dependent Haskell code, a full description of the differences between Dependent Haskell and today's Haskell, a novel type-safe dependently typed lambda-calculus (called Pico) suitable for use as an intermediate language for compiling Dependent Haskell, and a type inference and elaboration algorithm, Bake, that translates Dependent Haskell to type-correct Pico.

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

↑