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

Remove -none and -any version range syntax. #6589

Closed
phadej opened this issue Mar 16, 2020 · 2 comments
Closed

Remove -none and -any version range syntax. #6589

phadej opened this issue Mar 16, 2020 · 2 comments
Milestone

Comments

@phadej
Copy link
Collaborator

phadej commented Mar 16, 2020

They make version grammar non-declarative.

If we have grammar for Dependency as

PKGNAME OPTSPACE VERSIONRANGE

then valid package name foo and version range -any && >= 1 can be combined into

foo-any && >= 1

which isn't valid.

Yet, foo>=1 is valid (and often used).

Alternatively we can specify that space is mandatory before -any and -none tokens, that will make grammar less compositional.


TLDR; make version-range syntax so it cannot be interpretted as part of UnqualComponentName. Simplest solution is to require VersionRange to start with character not allowed in UnqualComponentName.

@phadej
Copy link
Collaborator Author

phadej commented Mar 17, 2020

Another reason to remove -any and -none is that they clash with constraint syntax:

constraints: foo -none

is that flag or version range? I'm not sure without trying.

@hvr
Copy link
Member

hvr commented Mar 18, 2020

I can't think of a good reason to keep -none or -any (even though I've certainly used -none in cabal.project/freeze files); the only reason I could think of is if we could give -none or -any some additional connotation beyond the semantics of <0 and >=0 that would make a difference for linters (such as cabal check) to signal intent; but then again I don't have a good use-case for that OTTOMH.

phadej added a commit to phadej/cabal that referenced this issue May 12, 2020
@phadej phadej closed this as completed in 8cc651c May 12, 2020
phadej added a commit that referenced this issue May 12, 2020
Resolve #6589: Remove -any and -none syntax
@phadej phadej added this to the 3.4.0.0-rc1 milestone Jul 13, 2020
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

No branches or pull requests

2 participants