© University of Kent - Contact | Feedback | Legal
The University of Kent, Canterbury, Kent, CT2 7NZ, T +44 (0)1227 764000
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, 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.
Download publication 168 kbytes (PDF)
@article{2847,
author = {Swierstra, S. Doaitse and Chitil, Olaf},
title = {Linear, bounded, functional pretty-printing},
month = {January},
year = {2009},
pages = {1--16},
keywords = {non-strict, lazy, Haskell},
note = {},
doi = {10.1017/S0956796808006990},
url = {http://www.cs.kent.ac.uk/pubs/2009/2847},
publication_type = {article},
submission_id = {17476_1231244975},
journal = {Journal of Functional Programming},
volume = {19},
number = {01},
publisher = {Cambridge University Press},
}