Fewer newlines
Although it's probably more diff-friendly, I think it looks super weird to have code like
x =
y
-- or
y
| x -> _
| foo -> _
In both of these cases y or | can be shifted up a line with no horizontal movement.
The implementation is reasonably simple with a caveat. When inserting a newline with no pending comments, check rcIndent against scColumn and if the column has already reached the required indent, don't insert a newline (and maybe push some spaces to reach rcIndent as further lines may require alignment).
The caveat is that this interacts quite poorly with the alignment branch, as scColumn is indeterminate until the expression is rendered fully...
The caveat is that this interacts quite poorly with the alignment branch, as
scColumnis indeterminate until the expression is rendered fully...
Perhaps an easy solution to this is to whenever we want access to scColumn deny the current line from taking part in alignment. This would make any column-dependent layout take precedence over alignment. Tricky to implement though as there could be several nested alignment contexts.