Generic deriving of generic traversals

Author:

Kiss Csongor1,Pickering Matthew2,Wu Nicolas2

Affiliation:

1. Imperial College London, UK

2. University of Bristol, UK

Abstract

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.

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference37 articles.

1. Template your boilerplate

2. Optimizing SYB is easy!

3. Optimizing SYB traversals is easy!

4. Lennart Augustsson. 2018. geniplate-mirror-0.7.6 library. http://hackage.haskell.org/package/geniplate-mirror-0.7.6 Lennart Augustsson. 2018. geniplate-mirror-0.7.6 library. http://hackage.haskell.org/package/geniplate-mirror-0.7.6

5. Understanding idiomatic traversals backwards and forwards

Cited by 5 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Staged sums of products;Proceedings of the 13th ACM SIGPLAN International Symposium on Haskell;2020-08-09

2. Describing microservices using modern Haskell (experience report);Proceedings of the 13th ACM SIGPLAN International Symposium on Haskell;2020-08-09

3. Staged selective parser combinators;Proceedings of the ACM on Programming Languages;2020-08-02

4. A promise checked is a promise kept: inspection testing;ACM SIGPLAN Notices;2018-12-07

5. A promise checked is a promise kept: inspection testing;Proceedings of the 11th ACM SIGPLAN International Symposium on Haskell;2018-09-17

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3