Single long line when doing pattern matching to extract record fields #268
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#268
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?
Hello, I'm just taking
brittany
out for a spin for the first time, it's a great work! but one thing I note does not work (I doubt is the desired result) is when doing pattern matching to extract fields from a record, I have enabledNamedFieldPuns
extension, and formats like this:That makes a very long line, I would rather prefer it to be formatted like this:
Is this possible to do? If not, what do you think? it could be added or the current behavior is the desired one?
Thanks!
I agree, and your preferred formatting looks good to me. We just have not come around to implementing anything in this direction, because patterns can appear in so many different places, and inventing proper layouts for some of them is mildly tricky.
See #143.
But your
let
example is relatively easy. Might be possible to implement something for let/where, but leaving the more complex contexts of function argument patterns, case, guards (ViewPatterns) etc. for later?I'll think on this.