Generalise stack machine helper function#164
Generalise stack machine helper function#164georgefst wants to merge 1 commit intohaskell-prettyprinter:masterfrom georgefst:master
Conversation
Pass annotation stack to text rendering argument.
sjakobi
left a comment
There was a problem hiding this comment.
This makes sense to me in light of your comment #163 (comment).
@quchen Could you review too?
| renderSimplyDecorated | ||
| :: Monoid out | ||
| => (Text -> out) -- ^ Render plain 'Text' | ||
| => ([ann] -> Text -> out) -- ^ Render plain 'Text' |
There was a problem hiding this comment.
The haddocks should say what the [ann] argument is.
There was a problem hiding this comment.
Fair point. Will add that if this gets merged.
|
Not sure this warrants a breaking change. The whole point of the simple renderers is to provide a fire-and-forget API. For special use cases with options and what not, a custom-built renderer seems to be the way to go. What use case that’s good for the broader audience does passing the annotation stack have? |
Fair enough. On reflection, this is probably more niche than I originally thought. Even in my case, there's a better solution that would involve improving the |
|
Hm, admittedly that's not the resolution that I had expected. It doesn't seem implausible to me that other users of |
Yeah, my sudden change of heart mostly comes from the realisation that I probably wouldn't use it anyway in the long run.
Probably true, but it's still a change people would have to adapt to, for no gain in most cases. And Anyway, this could be reopened, perhaps with the generalised form made in to a separate function, so that it's not a breaking change. And generalised further by e.g. passing the stack to the |
As suggested in #163.