Skip to main content
Kent Academic Repository

Pretty Printing with Delimited Continuations

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

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: Reports and Papers (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: 05 Nov 2024 09:48 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/14464 (The current URI for this page, for reference purposes)

University of Kent Author Information

  • Depositors only (login required):

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