Home
Scholarly Works
Lazy v. Yield: Incremental, Linear Pretty-Printing
Conference

Lazy v. Yield: Incremental, Linear Pretty-Printing

Abstract

We propose a programming style for incremental stream processing based on typed simple generators. It promotes modularity and decoupling of producers and consumers just like lazy evaluation. Simple generators, however, expose the implicit suspension and resumption inherent in lazy evaluation as computational effects, and hence are robust in the presence of other effects. Simple generators let us accurately reason about memory consumption. To substantiate our claims we give a new solution to the notorious pretty-printing problem. Like earlier solutions, it is linear, backtracking-free and with bounded latency. It is also simpler to write and reason about, and is compatible with effects including IO, letting us read the source document from a file, and format it as we read.

Authors

Kiselyov O; Peyton-Jones S; Sabry A

Series

Lecture Notes in Computer Science

Volume

7705

Pagination

pp. 190-206

Publisher

Springer Nature

Publication Date

December 1, 2012

DOI

10.1007/978-3-642-35182-2_14

Conference proceedings

Lecture Notes in Computer Science

ISSN

0302-9743
View published work (Non-McMaster Users)

Contact the Experts team