-
Notifications
You must be signed in to change notification settings - Fork 71
Add documentation for GHC-21926 #514
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
Conversation
message-index/messages/GHC-21926/version-number-in-package/index.md
Outdated
Show resolved
Hide resolved
extension: PackageImports | ||
--- | ||
|
||
Version number or non-alphanumeric character in the package. Alphanumeric characters are letters and numbers, as defined by `Data.Char.isAlphaNum`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit incomplete: a package name can include dashes, even while Data.Char.isAlphaNum '-' = False
.
The actual function GHC uses to validate package names is
looksLikePackageName = all (all isAlphaNum <&&> not . (all isDigit)) . split '-'
So probably something like "Each of dash-separated components of package name must consist of alphanumeric characters (as defined by Data.Char.isAlphaNum
), at least one of which is not a digit". What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply. Sounds good! Changed the code 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you push anything? I don't see any changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, rookie mistake. Pushed as f1fde5c
(#514).
Apologies for the inconvenience.
Thanks! |
This is the card I drew during ZuriHac! 📇
This is quite a simple parser error, which can be hit when
PackageImports
is enabled. The error itself is quite clear already: don't put version numbers and non-alphanumeric characters in a package import.I'm not sure how one would get into the non-alphanumeric character situation (besides an honest typo), but the version one is quite a fair mistake to make.