Skip to main content

Pretty Printing with Delimited Continuations

Chitil, Olaf (2006) Pretty Printing with Delimited Continuations. Technical report. University of Kent, Kent, UK (KAR id:14464)

PDF
Language: English
Click to download this file (147kB) Preview
[thumbnail of Pretty_Printing.pdf]
Preview
This file may not be suitable for users of assistive technology.
Request an accessible format

Abstract

Pretty printing is the task of nicely formatting tree structured data within a given line width limit. In 1980 Oppen published a pretty printing algorithm that takes time linear in the size of the input, independent of the line width, and uses only limited look-ahead. This work inspired the development of a number of purely functional pretty printing libraries in Haskell. Here I present a new functional pretty printing algorithm that has all the nice properties of Oppen's and is surprisingly simple. A double-ended queue of delimited continuations is the key to addressing all aspects of the problem explicitly.

Item Type: Monograph (Technical report)
Uncontrolled keywords: Haskell, double-ended queue, least-strict, lazy
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming,
Divisions: Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing
Depositing User: Olaf Chitil
Date Deposited: 24 Nov 2008 18:04 UTC
Last Modified: 16 Nov 2021 09:52 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/14464 (The current URI for this page, for reference purposes)
Chitil, Olaf: https://orcid.org/0000-0001-7986-9929
  • Depositors only (login required):

Total unique views for this document in KAR since July 2020. For more details click on the image.