Generic deriving of generic traversals
Generic deriving of generic traversals
复制标题
泛型遍历的泛型派生
DOI:
10.1145/3236780
复制
发表时间:
2018
影响因子:
--
通讯作者:
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
影响因子:
1.3
作者:
Adams M
通讯作者:
Adams M
DOI:
10.1145/2543728.2543730
发表时间:
2014
期刊:
--
影响因子:
--
作者:
Adams M
通讯作者:
Adams M