Pretty Printing with Delimited Continuations Report 4-06

Chitil, Olaf (2006) Pretty Printing with Delimited Continuations Report 4-06. Technical report. University of Kent (Full text available)

Download (127kB)


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: Faculties > Science Technology and Medical Studies > School of Computing > Theoretical Computing Group
Depositing User: Mark Wheadon
Date Deposited: 24 Nov 2008 18:04
Last Modified: 06 Sep 2011 01:34
Resource URI: (The current URI for this page, for reference purposes)
  • Depositors only (login required):


Downloads per month over past year