Pretty-printing: An exercise in functional programming
We designed a very small library (around one page) defining five combinators for pretty-printing. Despite, or perhaps because of their simplicity, these combinators have proved sufficiently efficient and expressive for quite extensive practical use. The combinators are simple to specify and enjoy many algebraic properties. The algebra is useful for reasoning about pretty-printers that use the library, and played an important role in deriving its implementations.
Unable to display preview. Download preview PDF.