ormolu/data
Utku Demir a0aa410741 Fix printing of TH brackets
The issue was simply indenting the closing `|]` one more level. However
there were a few more issues around them, which led me to a slightly
bigger refactor.

main reason is that, all `p_*Decl` functions used to print a trailing
newline. This makes sense for top-level constructs, however it was making
printing something like `[d|data Foo = Foo|]` impossible.

In this commit, I removed trailing newlines from individual printers
and gave that responsibility to `p_hsDecls`, and inserted an additional
trailing newline when printing modules.

While doing that, I noticed a few bugs/inconsistencies, and I had to
fix them in the process:

* Warning pragmas used to not print a trailing newline, so they were
always attached to the next expression. I made it more like the other
pragmas, where we attach it to a neighbour function if the name matches,
otherwise we separate it with a newline.
* We used to print single line GADT's and single line `do` notations
using multiple lines, which breaks idempotency. I tweak them to prefer
single line layout if possible (sometimes it is not possible because
of the semicolon syntax).
2019-08-08 11:30:20 +02:00
..
examples Fix printing of TH brackets 2019-08-08 11:30:20 +02:00
printer Change parens style and how separated lists of items are printed 2019-08-04 13:32:06 +02:00