There has been a lot of good intense work lately and as a result of that
some examples have grown considerably. The problem is that we do not show
diffs when something is not formatted as expected, we show entire
"expected/got" files. It works well when files are small, but not so well
where they are huge (some of our examples are well beyond 100 lines). It can
be hard to understand where the problem is.
This commit split long examples into smaller ones to make it easier to see
what went wrong when a test fails.
Goals:
* Make the set of combinators clearer and smaller.
* Solve a number of issues, such as those about parse failures related to
patterns.
* Solve the bug from #244.
The idea is very simple, we stop doing this
( foo
, bar
)
and start doing this
( foo,
bar
)
* We switch to trailing commas which solves the indentation issues for
patterns automatically.
* The new general ‘sep’ combinator finally is clear enough, and all the old
zoo of ‘velt’ and ‘velt'’ and ‘sepWith’, etc. which was confusing and
overlapping goes away.
Certain other kinds of declarations (such as associated type signatures and
bindings) are grouped together without newlines. The process for determining
which declarations are grouped reuses the same logic as for modules.
The PR changes the body layouting to use a span that includes the last point in
the name/pattern part of a match. This forces the layout to be multiline iff the
body starts on a newline.