Skip to content

instance Ord IntSet is broken since #670 #783

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

Closed
Bodigrim opened this issue Jun 23, 2021 · 11 comments · Fixed by #786
Closed

instance Ord IntSet is broken since #670 #783

Bodigrim opened this issue Jun 23, 2021 · 11 comments · Fixed by #786

Comments

@Bodigrim
Copy link
Contributor

Bodigrim commented Jun 23, 2021

Upgrading GHC 8.10.4 -> 8.10.5 appears more challenging than expected. This bug fix release actually bumps containers from 0.6.2.1 to 0.6.4.1, which is a 2500-lines long patch, breaking instance Ord IntSet:

$ cabal repl --constraint 'containers == 0.6.2.1'

> Data.IntSet.fromList [255,256] > Data.IntSet.singleton 254
True

$ cabal repl --constraint 'containers == 0.6.4.1’

> Data.IntSet.fromList [255,256] > Data.IntSet.singleton 254
False

CC @wz1000, because it would be nice to fix this one way or another in GHC 8.10.6.

@treeowl
Copy link
Contributor

treeowl commented Jun 23, 2021 via email

@bgamari
Copy link
Contributor

bgamari commented Jun 23, 2021

8.10.6 will indeed be blocked until this is fixed.

@sjakobi
Copy link
Member

sjakobi commented Jun 23, 2021

Indeed it looks like the bug is a result of the Ord IntSet changes in #670.

Ord IntMap looks correct:

instance Ord a => Ord (IntMap a) where
compare m1 m2 = compare (toList m1) (toList m2)

How about we simply go back to the old comparison via toList?

(CC @jwaldmann)

@wz1000
Copy link

wz1000 commented Jun 23, 2021

Are there any major bugs in 0.6.2.1? As noted, it is a pretty big bump for a minor release of the compiler, and I don't think there was a good reason for it. I suspect it might be best to revert the containers bump for GHC 8.10.6.

@treeowl
Copy link
Contributor

treeowl commented Jun 23, 2021 via email

@sjakobi
Copy link
Member

sjakobi commented Jun 23, 2021

Are there any major bugs in 0.6.2.1?

@wz1000 Unfortunately yes: https://hackage.haskell.org/package/containers-0.6.3.1/changelog

@treeowl
Copy link
Contributor

treeowl commented Jun 23, 2021

@jwaldmann , do you think this is a really quick fix, or should I revert #670 to get this out the door?

@wz1000
Copy link

wz1000 commented Jun 27, 2021

Any progress on this? 8.10.6 is getting really close and this is one of the remaining blockers.

@treeowl
Copy link
Contributor

treeowl commented Jun 27, 2021 via email

treeowl added a commit to treeowl/containers that referenced this issue Jun 28, 2021
Bodigrim found new `Ord` instance in haskell#783. Put the
old one one back.
treeowl added a commit to treeowl/containers that referenced this issue Jun 28, 2021
Bodigrim found new `Ord` instance in haskell#783. Put the
old one one back.

Fixes haskell#783.
treeowl added a commit to treeowl/containers that referenced this issue Jun 28, 2021
Bodigrim found a bug in the new `Ord` instance in haskell#783. Put the
old one one back.

Fixes haskell#783.
treeowl added a commit that referenced this issue Jun 28, 2021
Bodigrim found a bug in the new `Ord` instance in #783. Put the
old one one back.

Fixes #783.
@jwaldmann
Copy link
Contributor

@jwaldmann , do you think this is a really quick fix, or should I revert #670 to get this out the door?

yikes. No, I don't have a quick fix right now. Will try to look into this next week.

@treeowl
Copy link
Contributor

treeowl commented Jun 30, 2021

Thanks. I reverted the instance change for now (leaving the rest of your commit alone). It would be nice to understand how this slipped through the testing cracks (i.e., what made it hard to test) and plug that gap.

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

Successfully merging a pull request may close this issue.

6 participants