Closed paulcadman closed 12 months ago
l : List Nat := [1;2;3];
I would suggest [1; 2; 3]
, i.e., with spaces. It's similar to putting a space after a comma.
l : List Nat := [1;2;3];
I would suggest
[1; 2; 3]
, i.e., with spaces. It's similar to putting a space after a comma.
Thank you - yes this is better.
Have you thought about this format?
l : List Nat :=
[ someLongLongLongLongLongLongArg
; someLongLongLongLongLongLongArg
; someLongLongLongLongLongLongArg
];
It makes it easier to append elements to the list, which is quite common.
In this issue contains suggestions on how to improve the formatting of list literals that do not fit on a single line. They follow the ormolu formatting rules that we're familiar with from Haskell.
Example 1
Unformatted code
Current formatting
Suggested formatting:
Example 2
Unformatted code / Current formatting
The following is a list literal that cannot fit on one line.
Suggested formatting
Example 3
Unformatted code / Current formatting
The following is a list literal that fits on one line. We should not change this.
Suggested formatting