The unary minus is removed in the pattern of case expressions #49
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#49
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?
input:
output:
Thanks for reporting, I can reproduce and already see the cause - the minus is represented in the AST only as an annotation. Of course still an error on brittany's end. I'll fix this later.
@dplusic
The fix is not as easy as I had hoped because .. technical details. I have to contact the ghc-exactprint maintainers to
put the blame on them👿 see if there is chance to improve the interface so this is not as cumbersome to fix on brittany's end.I discovered a workaround: Enable -XNegativeLiterals (just in the brittany config, your code can stay the same).
I could fix just this particular instance of this bug relatively quickly, but then it would reappear when the negative literals appeared in some nested position in a pattern, so that's no good.
Nevermind, the fix turned out even easier than I had initially assumed. I just had to read the ghc sourcecode to make sense of its API. Fixed on
dev
branch.I checked fixed on
dev
. Thanks!