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

Correct semigroups conditional version bounds #134

Merged
merged 1 commit into from
Aug 16, 2016
Merged

Correct semigroups conditional version bounds #134

merged 1 commit into from
Aug 16, 2016

Conversation

RyanGlScott
Copy link
Member

Data.Semigroup was introduced in base-4.9 (GHC 8.0), but impl flag was causing vector to depend on the semigroups library even when GHC 8.0 was being used. This fixes it so that vector doesn't depend on semigroups for GHC 8.0.

@RyanGlScott RyanGlScott merged commit 1445edd into haskell:master Aug 16, 2016
@hvr
Copy link
Member

hvr commented Aug 17, 2016

@RyanGlScott

I don't agree with this commit because I can't reproduce the problem this is supposed to fix, and also because

if !impl(ghc > 8.0)

means, "if GHC is not used, or GHC is used and its version is less than or equal to 8.0"

however, there is no official GHC that has the version number "8.0"; it's always a 3-part version, i.e. "8.0.x".

whereas

if impl(ghc < 8.0)

means, "if GHC is used, and its version is smaller than 8.0", which is quite different semantically.

PS/EDIT: That being said, it's always suspicious if > is used rather than >= for lower version bounds, unless it's used to exclude single specific versions.

@RyanGlScott
Copy link
Member Author

@hvr, I apologize, it appears I didn't understand how ! interacts with impl. I'll revert this commit.

That being said, that behavior is quite unintuitive to me—I would expect if !impl(ghc > 8.0) to be logically equivalent to impl(ghc <= 8.0), and indeed the Cabal documentation doesn't seem to mention anything about this.

Your point about makeVersion [8,0] being less than makeVersion [8,0,x] is something I didn't consider, admittedly.

RyanGlScott added a commit that referenced this pull request Aug 17, 2016
This reverts commit 1445edd.

This is wholly unnecessary, since the version number `8.0` is less than
`8.0.x`, as pointed out in
#134 (comment)
@cartazio
Copy link
Contributor

You can write intersections of upper and lower bounds of impl versions , or
at least cabal accepts them :)

On Wednesday, August 17, 2016, Ryan Scott notifications@github.com wrote:

@hvr https://github.com/hvr, I apologize, it appears I didn't
understand how ! interacts with impl. I'll revert this commit.

That being said, that behavior is quite unintuitive to me—I would expect if
!impl(ghc > 8.0) to be logically equivalent to impl(ghc <= 8.0), and
indeed the Cabal documentation
https://github.com/haskell/cabal/blob/9b4712583ca390d0f034cc66eca4de51c00cc8d0/Cabal/doc/developing-packages.markdown#L1717
doesn't seem to mention anything about this.

Your point about makeVersion [8,0] being less than makeVersion [8,0,x] is
something I didn't consider, admittedly.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#134 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAQwtT3e2Jm9hOYX0v-DVLJz52ho0Nyks5qgwhHgaJpZM4JlYle
.

@RyanGlScott
Copy link
Member Author

Right, that's what's interesting about !'s interaction with impl. At first glance, I would expect something like if !impl(ghc >= 7.10 && < 8.0) to be exactly the same as impl(ghc < 7.10 || ghc >= 8.0), de Morgan–style. But that's not completely true, apparently—there's an additional stipulation that "If GHC isn't used, or impl(ghc < 7.10 || ghc >= 8.0)". That part wasn't clear at all to me, since I've never seen that written down anywhere.

@cartazio
Copy link
Contributor

Oh. I do the and outside the impl()

On Wednesday, August 17, 2016, Ryan Scott notifications@github.com wrote:

Right, that's what's interesting about !'s interaction with impl. At
first glance, I would expect something like if !impl(ghc >= 7.10 && < 8.0)
to be exactly the same as impl(ghc < 7.10 || ghc >= 8.0), de
Morgan–style. But that's not completely true, apparently—there's an
additional stipulation that "If GHC isn't used, or impl(ghc < 7.10 ||
ghc >= 8.0)". That part wasn't clear at all to me, since I've never seen
that written down anywhere.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#134 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAQwh0VmbDMIZvi-CprnaQJae1PaiaJks5qgwwOgaJpZM4JlYle
.

@hvr
Copy link
Member

hvr commented Aug 17, 2016

@RyanGlScott it's not so obvious, and it may be a good idea to write that one down in the cabal docs (you're not the first one to be surprised about it)

IMO: impl(ghc >= x.y) is trivially equivalent to impl(ghc) && impl(ghc >= x.y), and if you negate that, you end up with !impl(ghc) || !impl(ghc >= x.y), i.e. you get that additional !impl(ghc) term.

PS: no need to apologize!

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

Successfully merging this pull request may close these issues.

3 participants