Closed NicolasT closed 10 years ago
I'm certainly familiar with the Wadler & Leijen approach to pretty-printers. The use-case here isn't generic documents though. I think creating some Builder-like monoidal system and some interpreter for it is overkill, and adds more complexity to the user without gain: it's not the intention to be able to create/design arbitrary documents!
Agreed that we shouldn't make this unnecessarily generic.
Except for the leading ;
s this LGTM ;-)
it's more convenient (and faster) if you work with an intermediate sequence type. Maybe you should seek inspiration in the Wadler/Leijen prettier printer.