Skip to main content
    • Aa
    • Aa
  • Get access
    Check if you have access via personal or institutional login
  • Cited by 7
  • Cited by
    This article has been cited by the following publications. This list is generated based on data provided by CrossRef.

    Pardo, Alberto Fernandes, João Paulo and Saraiva, João 2016. Multiple intermediate structure deforestation by shortcut fusion. Science of Computer Programming,

    Kaminski, Ted and Van Wyk, Eric 2015. A modular specification of Oberon0 using the Silver attribute grammar system. Science of Computer Programming, Vol. 114, p. 33.

    Sloane, Anthony M. and Roberts, Matthew 2015. Oberon-0 in Kiama. Science of Computer Programming, Vol. 114, p. 20.

    Danvy, Olivier Thiemann, Peter and Zerny, Ian 2014. Proceedings of the 25th symposium on Implementation and Application of Functional Languages - IFL '13. p. 85.

    Radoi, Cosmin Fink, Stephen J. Rabbah, Rodric and Sridharan, Manu 2014. Translating imperative code to MapReduce. ACM SIGPLAN Notices, Vol. 49, Issue. 10, p. 909.

    Viera, Marcos and Swierstra, S. Doaitse 2014. Attribute grammar macros. Science of Computer Programming, Vol. 96, p. 211.

    Pardo, Alberto Fernandes, João Paulo and Saraiva, João 2011. Shortcut fusion rules for the derivation of circular and higher-order programs. Higher-Order and Symbolic Computation, Vol. 24, Issue. 1-2, p. 115.


Linear, bounded, functional pretty-printing

  • DOI:
  • Published online: 01 January 2009

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? *