lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
690 stars 72 forks source link

Consolidate record expression layouter #184

Closed eborden closed 6 years ago

eborden commented 6 years ago

Both record construction and update layouting have very similar constructions. These each had their own layouter with slightly different variations. Variations here lead to subtly different bugs in layout for nearly identical 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 similar forms.

Record constructors with fields and wildcards are not included in this consolidation. A TODO has been left to handle this consolidation later.

This fixes https://github.com/lspitzner/brittany/issues/176

lspitzner commented 6 years ago

thanks!