Support promoted type applications. #376
No reviewers
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#376
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "ChickenProp/promoted-type-applications"
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?
Closes #370.
Up to GHC 8.10,
was a valid type application. In GHC 9 it's not, which means brittany needs to allow
which it now does.
The reason the space was needed was to allow a promoted type variable at the head of a type-level list. That is,
is invalid syntax, because it initially parses as the character
'['
. So the promoted type variable was always given a separator at the beginning, and we'd getwhich was valid. Now we handle this case by specifically examining the head of a type-level list; if it's promoted we introduce spaces, so
I've added tests for this and some related cases. In doing so I noticed that unnecessary spaces get added in front of commas in these lists; I believe that's a separate bug, and I've written a comment explaining why it happens, but I haven't tried to fix it.
I'm not sure when the first alternates in the
FirstLastSingleton
andFirstLast
branches would ever be hit, so I'm not entirely sure if the separators are necessary there. But sincedocSeparator
disappears at the end of a line and merges with adjacent separators, they should be harmless.Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.