`OverloadedLabels` is a simple enough extension to parse and format. It
is becoming more common with use of `generic-lens`. Since it can be
treated as a `HsVar` its implementation only requires using `docLit`,
along with some marshalling for dealing with `FastString`.
Both record construction and record layouting have very similar
constructions. These each had their own layouter with slightly different
variations. Variations here lead to subtley different bugs in layout for
nearly identicle syntactic forms.
The record update logic is more advanced and respects `IndentPolicyLeft`.
Instead of keeping these layouters distinct we can consolidate
construction logic into the update logic. This results in a smaller
volume of code and more uniform layouting of syntax for these simlilar
forms.
Record constructors with fields and wildcards are not included in this
consolidation. A TODO has been left to handle this consolidation later.
Arguments of two function applications will only be aligned
if the same function is called in both cases.
The column transform was altered slightly to fix#65
properly as well.
fixes#65, #128
The following is wasteful of vertical space:
```
_ =
let
longIdentifierForShortValue = 1
in
longIdentifierForShortValue + longIdentifierForShortValue
```
We should format it on two lines if possible.
```
_ =
let longIdentifierForShortValue = 1
in longIdentifierForShortValue + longIdentifierForShortValue
```
This commit also allows for a mix of variations:
```
_ =
let
longIdentifierForShortValue = 1
in longIdentifierForShortValue + longIdentifierForShortValue
_ =
let longIdentifierForShortValue = 1
in
longIdentifierForShortValue + longIdentifierForShortValue
```
Let expressions with multiple bindings automattically indent and pull
left
```
let
a = b
c = d
in foo bar baz
```
```
let
a = b
c = d
in
foo bar baz
```
```
let
a = b
c = d
in foo
bar
baz
```
```
let
a = b
c = d
in
foo
bar
baz
```