Look up papers on pretty-printing with dynamic programming. “A prettier printer” was a good starting point, though in Haskell, so it might be easier to find something citing it using a perhaps-more-familiar language.
It's also given me the idea to ask around in functional-programming communities.
The "prettier printer" paper was actually more accessible than I expected it would be too :) although I get the impression it wants me to define group starts and ends before it does its work, and the algorithm I'm currently headscratching on works as a streaming buffer.
You're welcome! I think the lazy evaluation effectively does streaming -- that was the other reason to look at followup work, like the "Strictly Pretty" paper which had code in ML, a non-lazy language. I'm forgetting the titles of newer ones than that.
3 comments
[ 2.9 ms ] story [ 19.5 ms ] threadIt's also given me the idea to ask around in functional-programming communities.
The "prettier printer" paper was actually more accessible than I expected it would be too :) although I get the impression it wants me to define group starts and ends before it does its work, and the algorithm I'm currently headscratching on works as a streaming buffer.