stylish-haskell icon indicating copy to clipboard operation
stylish-haskell copied to clipboard

Top level patterns are not aligned when an expression is longer than the column limit.

Open TotallyNotChase opened this issue 4 years ago • 0 comments

Assume column limit is set to 80 (the default).

For a top level function that uses pattern matching-

f (x:xs) = undefined
f n@(x:y:z:rest) = undefined
f (x:y:rest) = undefined

Running stylish-haskell correctly formats it to-

f (x:xs)         = undefined
f n@(x:y:z:rest) = undefined
f (x:y:rest)     = undefined

However, if one of the alternatives is longer than the column limit, no formatting is performed-

f (x:xs) = undefined undefined undefined undefined undefined undefined undefined
f n@(x:y:z:rest) = undefined
f (x:y:rest) = undefined

I understand that simple alignment is supposed to apply "only to statements where each element occupies a single line" - but does this not count as "single line"?

TotallyNotChase avatar Jul 18 '21 13:07 TotallyNotChase