Closed georgefst closed 4 years ago
While I do feel hat pretty-simple
is a bit of an outlier with its laziness requirement, I agree that it would be nice if the renderLazy
output could be consumed in a streaming fashion.
The function is somewhat performance sensitive though. See e.g. https://github.com/quchen/prettyprinter/issues/121. So I hope we can keep the performance within 20% or so of the current implementation.
I think I'd also slightly prefer not to use monad transformers in the implementation, if that's possible.
This originally came up in discussion at cdepillabout/pretty-simple#67. Although it returns a lazy
Text
, there doesn't really seem to be any laziness inData.Text.Prettyprint.Doc.Render.Terminal.renderLazy
, presumably due to the use ofST
.For example, I would expect to see:
but instead the left-hand-side is just
⊥
.I could submit a PR fixing this, since I've already written the code (though I haven't benchmarked it...).