首页> 外文会议>ACM SIGPLAN international conference on functional programming >Instance Chains: Type Class Programming Without Overlapping Instances
【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 Haskell-style 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. Categories and Subject Descriptors D.3.2 [Programming Languages]: Language Classifications—Applicative (functional) languages; F.3.3 [Logics and Meanings of Programs]: Studies of Program Constructs—Type structure General Terms Design, Languages
机译:类型类在Haskell程序中找到了各种各样的用途,从简单的运算符重载(例如平等或排序)到用于实现类型安全异构列表或有限亚型的复杂不变。遗憾的是,许多富裕的类别使用类型类需要扩展到研究文献中未完全描述的类系统,并且在Haskell社区内不会普遍接受。本文介绍了一种在名为ilab的原型工具中实现的新型类系统,简化并增强了Haskell式类型类编程。在ILAB中,我们将重叠实例替换为具有新功能,实例链,允许在实例声明中显式交互和失败。我们介绍了一种将语义归类为类型系统,将类,实例和类约束(例如种类签名或功能依赖)的技术直接归类为类型的关系模型。最后,我们给出了ILAB的语义,并描述了其实施。类别和主题描述符D.3.2 [编程语言]:语言分类 - 申请(功能)语言; F.3.3 [程序的逻辑和含义]:方案结构的研究型结构一般术语设计,语言

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号