You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Haddock documentation for Distribution.Types.VersionRange.hasLowerBound explains (as it has since before Cabal-3.4.0.0):
--| Does the version range have an explicit lower bound?---- Note: this function only considers the user-specified lower bounds, but not-- the implicit >=0 lower bound.
Before Cabal-3.4.0.0, hasLowerBound anyVersion was False (anyVersion was AnyVersion). From Cabal-3.4.0.0, hasLowerBound anyVersion is True (the data constructor AnyVersion is no more, and anyVersion is now OrLaterVersion (mkVersion [0])).
Is this change in behaviour of hasLowerBound anyVersion what was intended when AnyVersion was dropped? Or should hasLowerBound v now begin not (isAnyVersion v) || ...?
Alternatively, could the current Haddock documentation be clarified, for example:
--| Does the version range have an explicit lower bound?---- Note: this function only considers the user-specified lower bounds, but not-- an implicit >=0 lower bound. @hasLowerBound anyVersion@ yields @True@ as-- the >=0 lower bound is express.
Edit: Depending on what was intended, I can raise a pull request.
The text was updated successfully, but these errors were encountered:
I feel like this is a change in the meaning of anyVersion from AnyVersion more than a change to hasLowerBound. Not sure in what cases it would make a difference, generally?
What prompted me to raise this was that Stack was relying on hasLowerBound to decide whether or not to add a lower bound in stack sdist --pvp-bounds lower - it only added a lower bound if one was not already expressed. When dependency my-package in a Cabal file went from meaning implied ">= 0" (AnyVersion) to meaning my-package >= 0 (express ">=0"), it stopped working (it is now fixed).
I doubt if different Haddock documentation would have headed off the Stack bug, but it might help somebody. Not least, because the data constructors of VersionRange are semi-opaque (they are exposed only in Distribution.Types.VersionRange.Internal).
Thanks for this report, I think its a wart semantically and probably should be cleaned up (in making anyVersion not have a lower bound) In general the changes to version stuff left us in a somewhat partial state, and this is another instance of that.
The Haddock documentation for
Distribution.Types.VersionRange.hasLowerBound
explains (as it has since beforeCabal-3.4.0.0
):Before
Cabal-3.4.0.0
,hasLowerBound anyVersion
wasFalse
(anyVersion
wasAnyVersion
). FromCabal-3.4.0.0
,hasLowerBound anyVersion
isTrue
(the data constructorAnyVersion
is no more, andanyVersion
is nowOrLaterVersion (mkVersion [0])
).Is this change in behaviour of
hasLowerBound anyVersion
what was intended whenAnyVersion
was dropped? Or shouldhasLowerBound v
now beginnot (isAnyVersion v) || ...
?Alternatively, could the current Haddock documentation be clarified, for example:
Edit: Depending on what was intended, I can raise a pull request.
The text was updated successfully, but these errors were encountered: