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

Generate _qualified_ imports to avoid clashes with user code #259

Merged
merged 6 commits into from
Feb 29, 2024

Conversation

andreasabel
Copy link
Member

@andreasabel andreasabel commented Feb 27, 2024

Commits:

  • Drop code generation for GHCs < 6.4 (removing some #ifs)
  • Qualified import of GHC.Exts in generated code
  • Qualified import of Debug.Trace in generated code
  • Qualified import of Data.Array in generated code
  • Bump to v3.5.1.0; CHANGELOG; update CI to GHC 9.8.2

Fixes #258

This could be released as 3.5.1.0 (minor bump), assuming that no one uses a contemporary alex to generate code for compilation with GHC 6.2 or lower.

Candidate: https://hackage.haskell.org/package/alex-3.5.1.0/candidate

These have been untested since long.
We can import the identifiers with `#` supported by all GHC versions
unqualified from `GHC.Exts`, not expecting any clash with user code.

Identifiers that are only known in newer versions of GHC, in
conditional code, are referred to qualified, e.g. `GHC.Exts.foo`.
@andreasabel andreasabel changed the title qualified imports Generate _qualified_ imports to avoid clashes with user code Feb 27, 2024
@andreasabel andreasabel added this to the 3.5.1.0 milestone Feb 27, 2024
@andreasabel andreasabel merged commit f8fe5f0 into master Feb 29, 2024
20 checks passed
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.

Alex generates code with unqualified imports, e.g. of GHC.Exts
1 participant