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

Support npm-style version ranges? #91

Closed
tfausak opened this issue Apr 22, 2016 · 8 comments
Closed

Support npm-style version ranges? #91

tfausak opened this issue Apr 22, 2016 · 8 comments

Comments

@tfausak
Copy link
Collaborator

tfausak commented Apr 22, 2016

I would love to be able to specify version numbers using npm's advanced range syntax. Stuff like 1.2.x, ~1.2.3, and ^1.2.3. I think the semver-range package can represent them, but I haven't ever played with it.

@soenkehahn
Copy link
Collaborator

Btw, cabal (and hpack) already support e.g. 1.2.*. Which I guess is equal to 1.2.x.

@tfausak
Copy link
Collaborator Author

tfausak commented Apr 22, 2016

That's true. I'm more interested in the tilde and caret specifiers.

@mitchellwrosen
Copy link
Collaborator

mitchellwrosen commented Aug 14, 2016

I'm willing to implement this but I want to make sure it's a welcome change, first. What do you think, @sol?

@sol
Copy link
Owner

sol commented Aug 15, 2016

Skimming through the documentation, I don't think you can translate this to Haskell directly. It seems that Node always uses major, minor, patch. This is not true for the Haskell. Firstly the pvp defines the major version as x.y, secondly you see a mixture of versions like 2, 2.1, 2.1.1, 2.0.0.1 on Hackage.

So if somebody thinks it's worth working on this, the first step would probably be to write down how exactly we would translate this to Haskell.

It may also make sense to consider each feature individually. E.g. I think version ranges could be nice, if we can figure out the semantics. On the other hand I'm not excited about .x as we already have star syntax.

@mitchellwrosen
Copy link
Collaborator

mitchellwrosen commented Aug 15, 2016

Hackage does allow e.g. 2, but to the cabal solver, this is the same as 2.0.0.0, no?

I think the overall ideas do translate directly to Haskell, we'd just have to account for major versions taking up two slots rather than one.

Agreed that .x doesn't make much sense, and it would be best to start with just one additional syntax, like 1.0 - 2.0

@soenkehahn
Copy link
Collaborator

IIRC to cabal 2 is not the same as 2.0.0.0. I think the constraint <= 2 would even disallow 2.0.0.0 because Data.Version says that 2 < 2.0.0.0. I may be wrong, though.

@sol
Copy link
Owner

sol commented Aug 15, 2016

I have some similar resemblance of something fishy there

Sent from mobile

On 15 Aug 2016, at 9:47 PM, Sönke Hahn [email protected] wrote:

IIRC to cabal 2 is not the same as 2.0.0.0. I think the constraint <= 2 would even disallow 2.0.0.0 because Data.Version says that 2 < 2.0.0.0. I may be wrong, though.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@sol
Copy link
Owner

sol commented Feb 22, 2017

As much as I like this idea, I think it's not straight forward to apply this to Cabal (see the comments of @soenkehahn an me above).

If somebody still wants aspects of this to happen (e.g. version ranges), then please feel free to open individual tickets for that.

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

4 participants