首页> 外文OA文献 >Type Classes in Functional Logic Programming (Author’s version for E-Prints Complutense)
【2h】

Type Classes in Functional Logic Programming (Author’s version for E-Prints Complutense)

机译:功能逻辑编程中的类型类(E-Prints Complutense的作者版本)

摘要

Type classes provide a clean, modular and elegant way of writing overloaded functions. Functional logic programming languages (FLP in short) like Toy or Curry have adopted the Damas-Milner type system, so it seems natural to adopt also type classes in FLP. However, type classes has been barely introduced in FLP. A reason for this lack of success is that the usual translation of type classes using dictionaries presents some problems in FLP like the absence of expected answers due to a bad interaction of dictionaries withudthe call-time choice semantics for non-determinism adopted in FLP systems.ududIn this paper we present a type-passing translation of typeudclasses based on type-indexed functions and type witnesses that is well-typed with respect to a new liberal type system recently proposed for FLP. We argue the suitability of this translation for FLP because it improves the dictionary-based one in three aspects. First, it obtains programs which run as fast or faster—with an speedup from 1.05 to 2.30 in our experiments. Second, it solves the mentioned problem of missing answers. Finally, the proposed translation generates shorter and simpler programs.ududud(C) ACM, (2011). This is the authors version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in PEPM ’11 Proceedings of the 20th ACM SIGPLAN workshop onudPartial evaluation and program manipulation (January 24–25, 2011, Austin, Texas, USA). http://doi.acm.org/10.1145/1929501.1929524.ud
机译:类型类提供了一种干净,模块化且优雅的方式来编写重载函数。诸如Toy或Curry之类的功能逻辑编程语言(简称FLP)已采用Damas-Milner类型系统,因此在FLP中也采用类型类似乎很自然。但是,在FLP中几乎没有引入类型类。缺乏成功的原因是,使用字典进行类型类的常规翻译在FLP中存在一些问题,例如由于字典与 LP在FLP中采用的非确定性的调用时选择语义的不良交互而导致缺少期望的答案 ud ud本文介绍基于类型索引函数和类型见证的类型 udclasss的类型传递转换,该转换相对于最近为FLP提出的新的自由类型系统是类型正确的。我们认为这种翻译对FLP的适用性是因为它在三个方面改进了基于字典的翻译。首先,它获得运行速度更快或更快的程序-在我们的实验中,速度从1.05提高到2.30。其次,它解决了提到的缺少答案的问题。最后,提出的翻译生成了更短,更简单的程序。 ud ud ud(C)ACM,(2011)。这是作品的作者版本。经ACM许可将其张贴在此处供您个人使用。不用于重新分配。最终版本已发布在第20届ACM SIGPLAN关于 ud部分评估和程序操纵的研讨会上的PEPM '11会议记录中(2011年1月24日至25日,美国德克萨斯州奥斯汀)。 http://doi.acm.org/10.1145/1929501.1929524.ud

著录项

  • 作者

    Martin-Martin Enrique;

  • 作者单位
  • 年度 2011
  • 总页数
  • 原文格式 PDF
  • 正文语种 en
  • 中图分类

相似文献

  • 外文文献
  • 中文文献
  • 专利

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号