-
Notifications
You must be signed in to change notification settings - Fork 89
Description
Currently, Ormolu always seems to format record updates and patterns with a space between the record data constructor or variable and the { like this:
foo {bar} instead of alternatives like foo{ bar } or foo{bar}.
This has the disadvantage that the {} part looks like an additional function parameter when used in function calls or pattern matches in function definitions, which is especially confusing to newbies:
foo a {b} c -- function call: looks like 3 parameters but is actually 2
foo Bar {baz} blerg = ... -- same with pattern match in function definition
Personally, I prefer foo{ bar }. It makes visually clear that the {} part belongs to the preceding identifier, while having superior readability compared to foo{bar}. Side note, it is only one character longer than the current foo {bar}.
If there are good reasons for this design decision, it would be nice to have them collected in the design document, or at least in this issue.