首页> 外文会议>ACM SIGPLAN international conference on functional programming >Boxes Go Bananas: Encoding Higher-Order Abstract Syntax with Parametric Polymorphism
【24h】

Boxes Go Bananas: Encoding Higher-Order Abstract Syntax with Parametric Polymorphism

机译:Boxes Go Bananas:使用参数多态性编码高阶摘要语法

获取原文

摘要

Higher-order abstract syntax is a simple technique for implementing languages with functional programming. Object variables and binders are implemented by variables and binders in the host language. By using this technique, one can avoid implementing common and tricky routines dealing with variables, such as capture-avoiding substitution. However, despite the advantages this technique provides, it is not commonly used because it is difficult to write sound elimination forms (such as folds or catamorphisms) for higher-order abstract syntax. To fold over such a datatype, one must either simultaneously define an inverse operation (which may not exist) or show that all functions embedded in the datatype are parametric. In this paper, we show how first-class polymorphism can be used to guarantee the parametricity of functions embedded in higher-order abstract syntax. With this restriction, we implement a library of iteration operators over data-structures containing functionals. From this implementation, we derive "fusion laws" that functional programmers may use to reason about the iteration operator. Finally, we show how this use of parametric polymorphism corresponds to the Schumann, Despeyroux and Pfenning method of enforcing parametricity through modal types. We do so by using this library to give a sound and complete encoding of their calculus into System F_ω. This encoding can serve as a starting point for reasoning about higher-order structures in polymorphic languages.
机译:高阶摘要语法是一种实现功能性编程的语言的简单技术。对象变量和绑定由主机语言中的变量和绑定实现。通过使用这种技术,可以避免实现处理变量的常见和棘手的例程,例如捕获避免替换。然而,尽管该技术提供了优势,但它不常用,因为难以为更高阶摘要语法编写声音消除形式(如折叠或壁素)。要折叠此类数据类型,必须同时定义逆操作(可能不存在)或显示嵌入在数据类型中的所有功能是参数。在本文中,我们展示了一流的多态如何用于保证嵌入在更高阶抽象语法中的功能的参数。通过这种限制,我们通过包含功能的数据结构来实现迭代运算符库。从这种实施来看,我们推出了“融合法”,功能程序员可能会用来推理迭代运营商。最后,我们展示了这种参数多态的使用方式对应于通过模态类型来强制执行参数的舒曼,Desceyroux和Pfenning方法。我们通过使用此库来进行系统f_Ω的微积分,对其微积分进行完整编码。该编码可以作为推理多态语言的高阶结构的起点。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号