Pretty printing with lazy dequeues

Author:

Chitil Olaf1

Affiliation:

1. University of Kent, United Kingdom

Abstract

There are several purely functional libraries for converting tree structured data into indented text, but they all make use of some backtracking. Over twenty years ago, Oppen published a more efficient imperative implementation of a pretty printer. This article shows that the same efficiency is also obtainable without destructive updates by developing a similar but purely functional Haskell implementation with the same complexity bounds. At its heart lie two lazy double ended queues.

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference10 articles.

1. Azero P. and Swierstra D. 1998. Optimal pretty-printing combinators. http://www.cs.uu.nl/groups/ST/Center/SoftwareDistributions. Azero P. and Swierstra D. 1998. Optimal pretty-printing combinators. http://www.cs.uu.nl/groups/ST/Center/SoftwareDistributions.

2. Using circular programs to eliminate multiple traversals of data;Bird R. S.;Acta Inf.,1984

3. A novel representation of lists and its application to the function “reverse”

4. Okasaki C. 1998. Purely Functional Data Structures. Cambridge University Press. Okasaki C. 1998. Purely Functional Data Structures. Cambridge University Press.

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

1. A Pretty Expressive Printer;Proceedings of the ACM on Programming Languages;2023-10-16

2. Towards a universal code formatter through machine learning;Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering;2016-10-20

3. Polynomial-Time Optimal Pretty-Printing Combinators with Choice;Lecture Notes in Computer Science;2015

4. A Pretty Good Formatting Pipeline;Software Language Engineering;2013

5. Lazy v. Yield: Incremental, Linear Pretty-Printing;Programming Languages and Systems;2012

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

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

www.globalauthorid.com

TOP

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