Skip to main content
    • Aa
    • Aa

Linear, bounded, functional pretty-printing


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.

Linked references
Hide All

This list contains references from the content that can be linked to their source. For a full set of references and notes please see the PDF or HTML where available.

Richard S. Bird (1984) Using circular programs to eliminate multiple traversals of data. Acta Inf. 21, 239250.

Olaf. Chitil (2005) Pretty printing with lazy dequeues. Trans. Prog. Lang. Syst. 27 (1), 163184.

John. Hughes (1995) {T}he {d}esign of a {p}retty-printing {l}ibrary. In Advanced Functional Programming, J. Jeuring & E. Meijer (eds), LNCS, vol. 925. Berlin: Springer-Verlag.

Dereck C. Oppen (1980) Pretty-printing. {ACM} Trans. Prog. Lang. Syst. 2 (4), 465483.

S. D. Swierstra , Alocer, P. R. Azero & J. Saraiva (1999) Designing and implementing combinator languages. In Advanced Functional Programming, Third International School, {AFP}'98, Doaitse Swierstra , Pedro Henriques , & José Oliveira (eds), LNCS, vol. 1608. Berlin: Springer-Verlag, pp. 150206.

Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *


Full text views

Total number of HTML views: 0
Total number of PDF views: 5 *
Loading metrics...

Abstract views

Total abstract views: 124 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 29th May 2017. This data will be updated every 24 hours.