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

Cabal init should generate more reasonable version bounds #1329

Closed
bgamari opened this Issue May 13, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@bgamari
Copy link
Contributor

bgamari commented May 13, 2013

cabal init currently sets unreasonably restrictive version bounds on dependencies (of the form my-dependency ==0.1.*). On the average it would be far more helpful if it would instead set bounds of the form my-dependency >= 0.1 && < 1.0 or even just my-dependency >= 0.1 && < 0.2. Not only are both of these conceptually closer to what is usually desired, they are also closer in edit distance, demanding less work from the author to fix the cases that cabal gets wrong.

@byorgey

This comment has been minimized.

Copy link
Member

byorgey commented May 13, 2013

Thanks for the suggestions! As for my-dependency >= 0.1 && < 1.0, the current design is based directly on the PVP and I'm not willing to change that unless there is significant consensus---or even better, a redesign to allow expressing both "hard" and "soft" upper bounds (i.e. "known not to work" vs "not known to work"). However, changing to my-dependency >= 0.1 && < 0.2 instead of 0.1.* is an excellent idea, which I'll look into.

@bgamari

This comment has been minimized.

Copy link
Contributor

bgamari commented May 13, 2013

That would be excellent!

@byorgey

This comment has been minimized.

Copy link
Member

byorgey commented May 13, 2013

It turns out this is ultimately due to the Distribution.Version module, which works very hard to "simplify" things like >= 0.1 && < 0.2 to == 0.1.*. But I think there is a workaround that isn't too bad.

@byorgey byorgey closed this in 3ef4f03 May 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment