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

Add min/max functions to Constraint #5

Open
malaire opened this issue Dec 1, 2018 · 1 comment
Open

Add min/max functions to Constraint #5

malaire opened this issue Dec 1, 2018 · 1 comment
Labels

Comments

@malaire
Copy link

malaire commented Dec 1, 2018

For package dependency calculations I need to get the min/max value of Constraint.

So I suggest adding two new functions which return min/max Version:s and their associated Op:s:

min : Constraint -> (Version, Op)
max : Constraint -> (Version, Op)

Note that this requires exposing Op(..).

(I removed my earlier idea here, this is better and can also have other uses with those exposes Op:s, e.g. with custom conversion to string or something else.)

@malaire malaire changed the title Add function which returns min/max of equivalent "min <= v < max". Add min/max functions to Constraint Dec 1, 2018
@malaire
Copy link
Author

malaire commented Dec 1, 2018

Another use case:

Exposing both Version:s and Op:s allows full customization of how Constraint is displayed e.g. in Html. For example one could add links to Version:s, or different styling for Version:s and Op:s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants