Very long type signatures are not dealt with well #299
Labels
No Label
blocked: dependency
blocked: info-needed
bug
duplicate
enhancement
fixed in HEAD
help wanted
hs:arrows
hs:brackets
hs:classes
hs:comments
hs:do-notation
hs:guards
hs:lists
hs:operators
hs:patterns
hs:records
hs:types
invalid
language extension support
layouting
needs confirmation
priority: high
priority: low
question
revisit before next release
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hexagoxel/brittany#299
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Consider the following type signature. Under the default settings, brittany version
0.12.1.1
does:Not great, but not terrible. However if you extend the type signature by just a little bit more:
Wow, what has happened here? Why all the extra unnecessary line breaks???
(Yes, regrettably my "real use-case" signature is similar, I am coding with dependent types. 😞 )
I tried screwing around with the config but it doesn't help either -
lconfig_hangingTypeSignature: true
doesn't affect this.Thanks for the reproduction case.
I am almost tempted to debug why exactly this happens, but this can and should best be resolved by rewriting the HsFunTy{} layouter, using the same technique that the value-level nested-operator layouter uses. Might even be able to remove the
docForceMultiline
construct after that and clean up the low-level stuff a bit.