Nonoptimal layouting in complex expression with default config #33
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#33
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?
This sample code:
requires config
with the default of 3 (instead of 5) brittany reformats the above to the non-optimal:
I cannot spot any particular bug in the layouting code here and it is certainly possible that pruning to 5 instead of 3 is necessary for examples of certain complexity.
Maybe the default config should be changed? Relevant questions:
Why don't we just use a list-comprehension there? It avoids tons of nesting..(this only applies to this specific case; the general question is not affected really)There is another approach to this: For certain nodes, non-bottom-spacing modifier could be adapted to also apply a
take 1
to the spacings. If applied carefully, this won't have any negative effects but might fix this and related issues. It'd also generally decrease the size of the search space.