Open isovector opened 2 years ago
I don't know how to do this. AFAIK Wadler-Leijen prettyprinters don't really support this.
https://github.com/natefaubion/purescript-dodo-printer/pull/8 is related work: Maybe it can be done after all?! We'll see.
The dodo-printer PR handles this by:
It also has stuff for box alignment (like align-self
in CSS) and padding, and omits trailing line alignment. This is kind of ridiculously complicated in PureScript because of stack safety and efficiency, but can be done straightforwardly in Haskell (depending on how you'd scan lines).
Edit: I should also say it assumes distributivity of annotations, which works well for things like ansi colors, but doesn't necessarily work for everything.
I have a doc that currently pretty prints as
but would instead like to produce
aligning on both the
:
and the(not in scope)
. Is this possible? I can't figure out how to getalign
to do this.