...
【24h】

Instance chains: type class programming without overlapping instances

机译:实例链:没有重叠实例的类型类编程

获取原文
获取原文并翻译 | 示例
   

获取外文期刊封面封底 >>

       

摘要

Type classes have found a wide variety of uses in Haskell programs, from simple overloading of operators (such as equality or ordering) to complex invariants used to implement type-safe heterogeneous lists or limited subtyping. Unfortunately, many of the richer uses of type classes require extensions to the class system that have been incompletely described in the research literature and are not universally accepted within the Haskell community. This paper describes a new type class system, implemented in a prototype tool called ilab, that simplifies and enhances Haskellstyle type-class programming. In ilab, we replace overlapping instances with a new feature, instance chains, allowing explicit alternation and failure in instance declarations. We describe a technique for ascribing semantics to type class systems, relating classes, instances, and class constraints (such as kind signatures or functional dependencies) directly to a set-theoretic model of relations on types. Finally, we give a semantics for ilab and describe its implementation.
机译:类型类已在Haskell程序中找到了广泛的用途,从简单的运算符重载(例如相等或排序)到用于实现类型安全的异构列表或有限子类型的复杂不变式。不幸的是,类型类的许多更丰富的用途要求对类系统进行扩展,这些扩展在研究文献中并未得到完整描述,并且在Haskell社区中未被普遍接受。本文介绍了一种新的类型类系统,该系统在名为ilab的原型工具中实现,可简化和增强Haskellstyle类型类编程。在ilab中,我们用新功能实例链替换了重叠的实例,从而允许实例声明中的显式替换和失败。我们描述了一种将语义赋予类型类系统,将类,实例和类约束(例如种类签名或功能依赖项)直接关联至类型关系的集合论模型的技术。最后,我们给出了ilab的语义并描述了其实现。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号