Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TH constructs added in GHC 9.4 #169

Merged
merged 5 commits into from
Jun 7, 2022
Merged

Support TH constructs added in GHC 9.4 #169

merged 5 commits into from
Jun 7, 2022

Conversation

RyanGlScott
Copy link
Collaborator

This adds support for the following TH constructs, newly introduced in GHC 9.4:

  • PromotedInfixT and PromotedUInfixT. These are desugared very similarly to InfixT and UInfixT.
  • DefaultD (default declarations).
  • OpaqueP (OPAQUE pragmas).
  • LamCasesE (\cases expressions). These are desugared to ordinary lambda expressions, similarly to how LamCaseE is desugared.

For more details, refer to the individual commit messages.

This addresses four check boxes in #157.

@RyanGlScott RyanGlScott requested a review from goldfirere May 31, 2022 12:18
We desugar `PromotedInfixT` to applications of `DConT` to two arguments,
mirroring the existing treatment for `InfixT`. By a similar token, attempting
to desugar `PromotedUInfixT` results in an error, just like what would happen
if you attempt to desugar `UInfixT` today.

Addresses one part of #157.
Template Haskell support for `default` declarations was added in GHC 9.4.

Addresses one part of #157.
The `OPAQUE` pragma was introduced in GHC 9.4.

Addresses one part of #157.
We desugar `\cases` expressions to ordinary lambda expressions, much like
`\case` expressions are currently desguared.

Addresses one part of #157.
Language/Haskell/TH/Desugar/Core.hs Show resolved Hide resolved
Language/Haskell/TH/Desugar/Core.hs Outdated Show resolved Hide resolved
Our treatment of promoted data constructors (in the forms of `PromotedT` and
`PromotedInfixT`) is somewhat unusual, but there are practical reasons for
doing so. The new `Note [Desugaring promoted types]` explains what these
reasons are.
@RyanGlScott RyanGlScott merged commit a30aa51 into master Jun 7, 2022
@RyanGlScott RyanGlScott deleted the T157 branch June 7, 2022 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants