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

Add genQuotedDecs option, generate fixity decs for infix names if False #430

Merged
merged 1 commit into from
Jan 13, 2020

Conversation

RyanGlScott
Copy link
Collaborator

This patch:

  • Introduces a genQuotedDecs :: Bool option that controls whether the q [Dec] arguments in the promote and singletons functions should be generated as part of their output.
  • Refactor promote{Only} and singletons{Only} to use genQuotedDecs.
  • Changes D.S.Promote.promoteInfixDecl so that it does promote fixity declarations for infix names when genQuotedDecs is False. (See the updated Note [singletons and fixity declarations] in D.S.Single.Fixity, wrinkle 1, for a more detailed explanation.) This fixes singletonsOnly and fixity declarations for infix names don't play nicely #326 in a much more robust way than the previous hacky workaround in commit 40c736f.

This patch:

* Introduces a `genQuotedDecs :: Bool` option that controls whether
  the `q [Dec]` arguments in the `promote` and `singletons` functions
  should be generated as part of their output.
* Refactor `promote{Only}` and `singletons{Only}` to use
  `genQuotedDecs`.
* Changes `D.S.Promote.promoteInfixDecl` so that it _does_ promote
  fixity declarations for infix names when `genQuotedDecs` is
  `False`. (See the updated
  `Note [singletons and fixity declarations]` in `D.S.Single.Fixity`,
  wrinkle 1, for a more detailed explanation.) This fixes #326 in a
  much more robust way than the previous hacky workaround in commit
  40c736f.
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.

singletonsOnly and fixity declarations for infix names don't play nicely
1 participant