Generic deriving of generic traversals

Generic deriving of generic traversals
复制标题

泛型遍历的泛型派生

DOI:
10.1145/3236780
复制
发表时间:
2018
影响因子:
--
通讯作者:
Nicolas Wu
Nicolas Wu
中科院分区:
--
文献类型:
--
作者:
Csongor Kiss;Matthew Pickering;Nicolas Wu

文献摘要

参考文献

被引文献

相似文献

函数式程序员有使用遍历作为设计模式来处理递归数据结构的既定传统。该技术非常丰富,以至于已经设计了一整套库来帮助通过分析数据类型的泛型结构自动提供遍历的任务。最近,镜头已经进入了功能场景,并证明了自己是一种简单而通用的处理产品类型的机制。它们使得以可组合和可重用的方式关注数据结构的重要部分变得容易。本文使用透镜和遍历的结合,产生了一个具有前所未有的表达能力和灵活性的库,用于查询和修改复杂的数据结构。此外,由于透镜和遍历是基于数据的一般形状,因此该信息用于生成与手动优化版本一样高效的代码。该技术利用数据的结构来产生通用的抽象,然后被现代函数编译器的标准工作消除:内联和专门化。
Functional programmers have an established tradition of using traversals as a design pattern to work with recursive data structures. The technique is so prolific that a whole host of libraries have been designed to help in the task of automatically providing traversals by analysing the generic structure of data types. More recently, lenses have entered the functional scene and have proved themselves to be a simple and versatile mechanism for working with product types. They make it easy to focus on the salient parts of a data structure in a composable and reusable manner. This paper uses the combination of lenses and traversals to give rise to a library with unprecedented expressivity and flexibility for querying and modifying complex data structures. Furthermore, since lenses and traversals are based on the generic shape of data, this information is used to generate code that is as efficient as hand-optimised versions. The technique leverages the structure of data to produce generic abstractions that are then eliminated by the standard workhorses of modern functional compilers: inlining and specialisation.
DOI: 10.1145/2503778.2503781
发表时间: 2013
期刊: --
影响因子: --
作者:
Bird R
通讯作者: Bird R
优化 SYB 遍历非常简单!
DOI: 10.1016/j.scico.2015.09.003
发表时间: 2015
影响因子: 1.3
作者:
Adams M
通讯作者: Adams M
优化 SYB 很简单!
DOI: 10.1145/2543728.2543730
发表时间: 2014
期刊: --
影响因子: --
作者:
Adams M
通讯作者: Adams M