2 ms·
This is a bit like '%r' or repr() in Python, the Debug trait in Rust, or the Show class in Haskell, but it doesn't really address what most pretty printers need
by kccqzy 8y ago
This is a bit like '%r' or repr() in Python, the Debug trait in Rust, or the Show class in Haskell, but it doesn't really address what most pretty printers need: highly customized formatting, as used in Wadler/Leijen pretty printers.
- tommikaikkonen 8y agoIndeed. I wrote a Python pretty printer that uses a Wadler/Leijen algorithm, and it's a great fit. It doesn't take too long to learn how to use the layout primitives, and it allows for easy creation of higher level abstractions while still maintaining plenty of control. https://github.com/tommikaikkonen/prettyprinter https://github.com/tommikaikkonen/prettyprinter