The right kind of generic programming

The right kind of generic programming
复制标题

正确的泛型编程类型

DOI:
--
复制
发表时间:
2012
期刊:
Workshop on Generic Programming
影响因子:
--
通讯作者:
José Pedro Magalhães
José Pedro Magalhães
中科院分区:
--
文献类型:
--
作者:
José Pedro Magalhães

文献摘要

被引文献

相似文献

Haskell以其强大的静态类型系统而闻名。一个好的类型系统对值进行分类,约束语言的有效项,并防止许多常见的编程错误。格拉斯哥Haskell编译器(GHC)进一步扩展了Haskell的类型语言,增加了对类型级计算和显式类型相等约束的支持。 类型级编程用于对值进行分类,但类型本身仍然是众所周知的未分类。然而,最近扩展了kind级别语言,支持用户定义的kind和kind多态性。在本文中,我们重新审视泛型编程方法,在很大程度上依赖于类型级计算,并分析如何改善他们的扩展类语言。出于指导性目的,我们列出了一系列由新功能提供的优点,以及一些阻止理想使用模式的缺点。
Haskell is known for its strong, static type system. A good type system classifies values, constraining the valid terms of the language and preventing many common programming errors. The Glasgow Haskell Compiler (GHC) has further extended the type language of Haskell, adding support for type-level computation and explicit type equality constraints. Type-level programming is used to classify values, but types themselves have remained notoriously unclassified. Recently, however, the kind-level language was extended with support for user-defined kinds and kind polymorphism. In this paper we revisit generic programming approaches that rely heavily on type-level computation, and analyse how to improve them with the extended kind language. For instructive purposes, we list a series of advantages given by the new features, and also a number of shortcomings that prevent desirable use patterns.