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

Use explicit namespace specifiers when promoting/singling fixity declarations #598

Merged
merged 1 commit into from
Jun 6, 2024

Commits on Jun 6, 2024

  1. Use explicit namespace specifiers when promoting/singling fixity decl…

    …arations
    
    During promotion, we now give promoted fixity declarations the `type`
    namespace, and during singling, we now give singled fixity declarations the
    `type` namespace (if it is a singled class declaration) or the `data` namesapce
    (for all other singled names). Doing so makes our intentions clearer, and it
    also future-proofs the code against planned GHC changes discussed in [GHC
    proposal
    65](https://github.com/ghc-proposals/ghc-proposals/blob/8443acc903437cef1a7fbb56de79b6dce77b1a09/proposals/0065-type-infix.rst#migration-plan),
    where specifier-less fixity declarations (e.g., `infixl 4 %%%`) will become an
    error if they refer to both a term-level and type-level `%%%` name.
    
    We now also take namespace specifiers into account when promoting fixity
    declarations. This is because `Wrinkle 1: When not to promote/single fixity
    declarations` in `Note [singletons-th and fixity declarations]` describes a
    special case where we must avoid promoting fixity declarations for infix names,
    but this workaround only needs to be used if the fixity declaration lacks an
    explicit namespace specifier. If it _does_ have an explicit namespace specifier
    (e.g., `infixl 4 data %%%`), then we can promote it (e.g., to `infixl 4 type
    %%%`) without fear of name clashes.
    
    Fixes #582.
    RyanGlScott committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    922097f View commit details
    Browse the repository at this point in the history