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

类型类和约束处理规则

Type Classes and Constraint Handling Rules

Kevin Glynn, Martin Sulzmann, Peter J. Stuckey

摘要:

类型类是对传统的基于Hindley-Milner的类型系统的优雅扩展。它们用于现代类型化语言,如Haskell,以支持符号的受控重载。Haskell 98只支持单参数和构造函数类型的类。其他扩展,如多参数类型类,是非常需要的,但仍然没有得到Haskell的正式支持。扩展会产生一些微妙的问题,这可能会导致丢失可行的类型推断或模糊的程序。类型分类系统的适当逻辑基础似乎缺失了。这样的基础将允许扩展的特点和严格的研究。我们建议采用约束处理规则作为一种工具,研究和开发的类型类系统在一个统一的方式。

英文摘要:

Type classes are an elegant extension to traditional, Hindley-Milner based typing systems. They are used in modern, typed languages such as Haskell to support controlled overloading of symbols. Haskell 98 supports only single-parameter and constructor type classes. Other extensions such as multi-parameter type classes are highly desired but are still not officially supported by Haskell. Subtle issues arise with extensions, which may lead to a loss of feasible type inference or ambiguous programs. A proper logical basis for type class systems seems to be missing. Such a basis would allow extensions to be characterised and studied rigorously. We propose to employ Constraint Handling Rules as a tool to study and develop type class systems in a uniform way.

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

↑