Hostname: page-component-77f85d65b8-8v9h9 Total loading time: 0 Render date: 2026-03-27T17:04:14.276Z Has data issue: false hasContentIssue false

Linear, bounded, functional pretty-printing

Published online by Cambridge University Press:  01 January 2009

S. DOAITSE SWIERSTRA
Affiliation:
Utrecht University, The Netherlands
OLAF CHITIL
Affiliation:
University of Kent, UK
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

We present two implementations of Oppen's pretty-printing algorithm in Haskell that meet the efficiency of Oppen's imperative solution but have a simpler and a clear structure. We start with an implementation that uses lazy evaluation to simulate two co-operating processes. Then we present an implementation that uses higher-order functions for delimited continuations to simulate co-routines with explicit scheduling.

Information

Type
Functional Pearls
Copyright
Copyright © Cambridge University Press 2008
Submit a response

Discussions

No Discussions have been published for this article.