Skip to content

Commit

Permalink
Use "pkg == 1.2.*" as the version wildcard syntax
Browse files Browse the repository at this point in the history
Rather than "pkg ~ 1.2.*". This seemed to be the consensus.
The syntax "pkg == 1.2.*" means "pkg >= 1.2 && < 1.3" and it
is to encourage people to put upper bounds on api versions.
  • Loading branch information
dcoutts committed Jul 29, 2008
1 parent bd70616 commit f9a1a5c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Distribution/Version.hs
Expand Up @@ -133,7 +133,7 @@ instance Text VersionRange where
(UnionVersionRanges (ThisVersion v1) (LaterVersion v2))
(EarlierVersion v3))
| v1 == v2 && isWildcardRange (versionBranch v1) (versionBranch v3)
= Disp.char '~' <> disp (VersionWildcard (versionBranch v1))
= Disp.text "==" <> disp (VersionWildcard (versionBranch v1))
disp (IntersectVersionRanges r1 r2)
= disp r1 <+> Disp.text "&&" <+> disp r2

Expand All @@ -158,8 +158,8 @@ instance Text VersionRange where
: parseWildcardRange
: map parseRangeOp rangeOps
parseAnyVersion = Parse.string "-any" >> return AnyVersion
parseWildcardRange = Parse.char '~' >> Parse.skipSpaces
>> fmap wildcardRange parse
parseWildcardRange = Parse.string "==" >> Parse.skipSpaces
>> fmap wildcardRange parse
parseRangeOp (s,f) = Parse.string s >> Parse.skipSpaces >> fmap f parse
rangeOps = [ ("<", EarlierVersion),
("<=", orEarlierVersion),
Expand Down

0 comments on commit f9a1a5c

Please sign in to comment.