Pretty printing with lazy dequeues
- 1 January 2005
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 27 (1), 163-184
- https://doi.org/10.1145/1053468.1053473
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.Keywords
This publication has 4 references indexed in Scilit:
- Purely Functional Data StructuresPublished by Cambridge University Press (CUP) ,1998
- A novel representation of lists and its application to the function “reverse”Information Processing Letters, 1986
- Using circular programs to eliminate multiple traversals of dataActa Informatica, 1984
- PrettyprintingACM Transactions on Programming Languages and Systems, 1980