Large case pattern should respect line lengths #143
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#143
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?
A new corner case for you. :)
With default options, 0.11 produces
Yeah, i know. Pattern layouting is not complete for any non-single-line cases. And unfortunately this has somewhat low priority for me, as such patterns usually are best avoided. Although I don't see any workaround for your example there.
(If you want to have a go at improving this, the relevant brittany module is
Language.Haskell.Brittany.Internal.Layouters.Pattern
. Although some other code might be affected as well which currently relies on the "patterns are single-line" assumption.)At least you now have the option of making use of
-- brittany-disable-next-binding
and layout this one by hand. Presuming that you only have a few of these cases.Maybe @kanishka-azimi has an opinion on the size of the pattern in this particular case. But anyway, that brittany directive shall certainly come in handy!