> I often format code in a specific way for regularity:
I am trying to write my own formatter at the moment, and this is exactly the property I want, also. I'm working in Haskell, and one example is case statements. There are two ways I'd like to format them:
case foo of
A -> ...
B -> ...
or
case foo of
A ->
...
B ->
...
The first is when every case fits on one line, but the second is when at least one case needs to span multiple lines. I don't want this:
case foo of
A ->
...
B -> ...
I haven't yet come up with a good way to do that heuristically and efficiently, but maybe just looking at how the original code is formatted would be enough! Thanks for providing some food for thought :)