-
Notifications
You must be signed in to change notification settings - Fork 703
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Caret-style version range operator
This implements a new syntactic sugar: The version range operator `^>=` which is equivalent to `>=` intersected with an automatically inferred major upper bound. This new syntax is only allowed for `cabal-version: >=2.0`, and allows to describe the most common use of version bounds more conveniently: build-depends: foo ^>= 1.2.3.4, bar ^>= 1 The declaration above is exactly equivalent to build-depends: foo >= 1.2.3.4 && < 1.3, bar >= 1 && < 1.1 The `^`-symbol was chosen because it can serve as a mnemonic when the `>` sign is rotated and interpreted as "less than upper bound" Moreover, `^` appears to become a quasi-standard to denote morally equivalent operator that way in other language ecosystems which similiar to Haskell have adopted semantic versioning: - Node: https://nodesource.com/blog/semver-tilde-and-caret/ - Bower: https://bower.io/docs/api/#install - PHP: https://getcomposer.org/doc/articles/versions.md#caret Ruby, on the other hand, uses a Tilde operator (`~>`) for that purpose (but with a less robust semantic): - https://blog.codeship.com/optimists-guide-pessimistic-library-versioning And Python is currently planing to use an `~=` operator: - https://www.python.org/dev/peps/pep-0440/#compatible-release
- Loading branch information
Showing
5 changed files
with
107 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ | |
* Internal 'build-tools' dependencies are now added to PATH | ||
upon invocation of GHC, so that they can be conveniently | ||
used via `-pgmF`. (#1541) | ||
* Add support for new caret-style version range operator `^>=` (#3705) | ||
|
||
1.24.0.0 Ryan Thomas <[email protected]> March 2016 | ||
* Support GHC 8. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters