...
首页> 外文期刊>Higher-order and symbolic computation >A principled approach to programming with nested types in Haskell
【24h】

A principled approach to programming with nested types in Haskell

机译:Haskell中使用嵌套类型进行编程的一种原则方法

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

摘要

Initial algebra semantics is one of the cornerstones of the theory of modern functional programming languages. For each inductive data type, it provides a Church encoding for that type, a build combinator which constructs data of that type, a fold combina-tor which encapsulates structured recursion over data of that type, and a fold/build rule which optimises modular programs by eliminating from them data constructed using the build combinator, and immediately consumed using the fold combinator, for that type. It has long been thought that initial algebra semantics is not expressive enough to provide a similar foundation for programming with nested types in Haskell. Specifically, the standard folds derived from initial algebra semantics have been considered too weak to capture commonly occurring patterns of recursion over data of nested types in Haskell, and no build combinators or fold/build rules have until now been defined for nested types. This paper shows that standard folds are, in fact, sufficiently expressive for programming with nested types in Haskell. It also defines build combinators and fold/build fusion rules for nested types. It thus shows how initial algebra semantics provides a principled, expressive, and elegant foundation for programming with nested types in Haskell.
机译:初始代数语义是现代功能编程语言理论的基石之一。对于每种归纳数据类型,它都提供该类型的Church编码,构建该类型的数据的构建组合器,折叠该类型的数据的结构化递归的折叠组合器以及优化模块化程序的折叠/构建规则通过从它们中消除使用构建组合器构造的数据,并立即使用折叠组合器消耗该类型的数据。长期以来,人们一直认为初始代数语义的表达能力不足以为在Haskell中使用嵌套类型进行编程提供类似的基础。特别是,从初始代数语义派生的标准折叠被认为太弱而无法捕获Haskell中嵌套类型数据的常见递归模式,并且到目前为止,还没有为嵌套类型定义任何构建组合器或折叠/构建规则。本文表明,实际上,标准折叠对于在Haskell中使用嵌套类型进行编程具有足够的表现力。它还为嵌套类型定义了构建组合器和折叠/构建融合规则。因此,它显示了初始代数语义是如何为Haskell中的嵌套类型编程提供原理性,表达性和优雅的基础的。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号