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

hashable 1.4.0.0 #6268

Closed
1 of 9 tasks
bergmark opened this issue Oct 31, 2021 · 31 comments · Fixed by #6370
Closed
1 of 9 tasks

hashable 1.4.0.0 #6268

bergmark opened this issue Oct 31, 2021 · 31 comments · Fixed by #6370

Comments

@bergmark
Copy link
Member

bergmark commented Oct 31, 2021

data was renewed on 2022-02-12 by juhp

hashable-1.4.0.2 (changelog) (Grandfathered dependencies) is out of bounds for:

This is wrt nightly-2022-02-12

@brandon-leapyear
Copy link
Contributor

brandon-leapyear commented Oct 31, 2021

This is an old work account. Please reference @brandonchinn178 for all future communication


Bumped aeson-schema bounds

@Bodigrim
Copy link
Contributor

Bumped extended-reals and data-interval.

@phadej
Copy link
Contributor

phadej commented Nov 1, 2021

When I estimated the breakage, I needed to write patches for

packages: mfsolve-0.3.2.0
packages: log-domain-0.13.1
packages: approximate-0.3.4
packages: registry-0.2.0.3
packages: trifecta-2.1.1
packages: clash-prelude-1.4.3
packages: clash-lib-1.4.3
packages: medea-1.2.0
packages: hgeometry-0.12.0.4
packages: reanimate-1.1.4.0

They were quite straightforward.
If libraries support GHC-7 still, please check GHC-7.10, the transformers bundled has different Eq1 (if the patches add it, log-domain, and approximate)
I think its fine option to drop GHC-7 support though at this point of time.

mfsolve

--- orig/mfsolve-0.3.2.0/Math/MFSolve.hs	2016-01-12 00:24:56.000000000 +0200
+++ mfsolve-0.3.2.0/Math/MFSolve.hs	2021-09-01 11:29:40.338627207 +0300
@@ -1,4 +1,5 @@
 {-# LANGUAGE DeriveGeneric, PatternGuards, PatternSynonyms, MultiParamTypeClasses, FlexibleContexts, DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE StandaloneDeriving  #-}
 
 {-|
 Module      : Math.MFSolve
@@ -198,6 +199,9 @@
   SinExp (Expr v n)
   deriving Generic
 
+deriving instance (Eq v, Eq n) => Eq (NonLinExpr v n)
+deriving instance (Eq v, Eq n) => Eq (Expr v n)
+
 -- | An angular function of the form @c + n*sin(theta + alpha)@
 -- where @theta@, and @n@ are linear terms, @alpha@ and @c@ are constants.
 type LinearMap v n = M.HashMap v (LinExpr v n)

log-domain

--- orig/log-domain-0.13.1/src/Numeric/Log.hs	2001-09-09 04:46:40.000000000 +0300
+++ log-domain-0.13.1/src/Numeric/Log.hs	2021-09-01 14:30:02.786633058 +0300
@@ -52,6 +52,7 @@
 import Numeric
 import Text.Read as T
 import Text.Show as T
+import Data.Functor.Classes
 
 -- $setup
 -- >>> let Exp x ~= Exp y = abs ((exp x-exp y) / exp x) < 0.01
@@ -96,6 +97,9 @@
 instance Hashable1 Log where
   liftHashWithSalt hws i (Exp a) = hws i a
   {-# INLINE liftHashWithSalt #-}
+    
+instance Eq1 Log where
+  liftEq eq (Exp a) (Exp b) = eq a b
 
 instance Storable a => Storable (Log a) where
   sizeOf = sizeOf . ln

approximate

I got lazy here

--- orig/approximate-0.3.4/src/Data/Approximate/Mass.hs	2001-09-09 04:46:40.000000000 +0300
+++ approximate-0.3.4/src/Data/Approximate/Mass.hs	2021-09-01 15:57:10.841560644 +0300
@@ -34,6 +34,7 @@
 import Data.Functor.Extend
 import Data.Hashable (Hashable(..))
 import Data.Hashable.Lifted (Hashable1(..))
+import Data.Functor.Classes
 import Data.Pointed
 import Data.SafeCopy
 #if !(MIN_VERSION_base(4,11,0))
@@ -91,6 +92,9 @@
   getCopy = contain Serialize.get
   putCopy = contain . Serialize.put
 
+instance Eq1 Mass where
+    liftEq eq (Mass m x) (Mass n y) = m == n && eq x y
+
 instance Hashable a => Hashable (Mass a)
 instance Hashable1 Mass where
     liftHashWithSalt h s (Mass m x) = hashWithSalt s m `h` x
diff -ur orig/approximate-0.3.4/src/Data/Approximate/Type.hs approximate-0.3.4/src/Data/Approximate/Type.hs
--- orig/approximate-0.3.4/src/Data/Approximate/Type.hs	2001-09-09 04:46:40.000000000 +0300
+++ approximate-0.3.4/src/Data/Approximate/Type.hs	2021-09-01 16:07:22.417029911 +0300
@@ -46,6 +46,7 @@
 import Data.Vector.Unboxed as U
 import GHC.Generics
 import Numeric.Log
+import Data.Functor.Classes
 
 -- | An approximate number, with a likely interval, an expected value and a lower bound on the @log@ of probability that the answer falls in the interval.
 --
@@ -72,6 +73,9 @@
   getCopy = contain Serialize.get
   putCopy = contain . Serialize.put
 
+instance Eq1 Approximate where
+    liftEq _ _ _ = False -- I'm lazy atm
+
 instance Hashable a => Hashable (Approximate a)
 instance Hashable1 Approximate where
     liftHashWithSalt h s (Approximate c low est high) =

registry

I forgot the details about this patch, but IIRC there was something too clever happening.
Something where I would use instances, but rather explicit combinators.
E.g. liftHashWithSalt2 may be useful to hash a pair using two explicit hashers,
Though even written explicitly as

salt `hashX` x `hashY` y

is not that bad.

--- orig/registry-0.2.0.3/src/Data/Registry/Internal/Dot.hs	2020-06-22 12:13:17.000000000 +0300
+++ registry-0.2.0.3/src/Data/Registry/Internal/Dot.hs	2021-09-01 18:32:31.018165019 +0300
@@ -104,8 +104,7 @@
 
 -- | Return the hash of a value based on its dependencies
 hashOf :: Value -> Int
-hashOf value = hash
-  (unDependencies . valDependencies $ value, valDescription value)
+hashOf value = hash (unDependencies . valDependencies $ value, valDescription value)
 
 -- | Description of a Value in the DOT graph
 nodeDescription :: ValueDescription -> ValueCounter -> Text
diff -ur orig/registry-0.2.0.3/src/Data/Registry/Internal/Types.hs registry-0.2.0.3/src/Data/Registry/Internal/Types.hs
--- orig/registry-0.2.0.3/src/Data/Registry/Internal/Types.hs	2019-06-19 10:30:34.000000000 +0300
+++ registry-0.2.0.3/src/Data/Registry/Internal/Types.hs	2021-09-01 18:33:53.969400523 +0300
@@ -30,9 +30,12 @@
   | ProvidedValue Dynamic ValueDescription
   deriving (Show)
 
+-- compare descriptions
+instance Eq Value where
+    x == y = valDescription x == valDescription y
+
 instance Hashable Value where
-  hash value = hash (valDescription value)
-  hashWithSalt n value = hashWithSalt n (valDescription value)
+    hashWithSalt salt value = hashWithSalt salt (valDescription value)
 
 -- | Description of a value. It might just have
 --   a description for its type when it is a value

trifecta

--- orig/trifecta-2.1.1/src/Text/Trifecta/Rope.hs	2001-09-09 04:46:40.000000000 +0300
+++ trifecta-2.1.1/src/Text/Trifecta/Rope.hs	2021-09-01 19:13:31.041632219 +0300
@@ -59,7 +59,7 @@
 data Strand
   = Strand {-# UNPACK #-} !ByteString !Delta -- ^ Data of a certain length
   | Skipping !Delta                          -- ^ Absence of data of a certain length
-  deriving (Show, Data, Typeable, Generic)
+  deriving (Eq, Show, Data, Typeable, Generic)
 
 -- | Construct a single 'Strand' out of a 'ByteString'.
 strand :: ByteString -> Strand

medea

--- orig/medea-1.2.0/src/Data/Medea/ValidJSON.hs	2001-09-09 04:46:40.000000000 +0300
+++ medea-1.2.0/src/Data/Medea/ValidJSON.hs	2021-09-01 22:19:24.114888330 +0300
@@ -24,7 +24,7 @@
   | StringF {-# UNPACK #-} !Text
   | ArrayF {-# UNPACK #-} !(Vector a)
   | ObjectF !(HashMap Text a)
-  deriving stock (Functor, Typeable, Data)
+  deriving stock (Eq, Functor, Typeable, Data)
 
 instance Foldable ValidJSONF where
   {-# INLINE foldMap #-}

hgeometry

--- orig/hgeometry-0.12.0.4/src/Data/Geometry/Vector/VectorFamilyPeano.hs	2001-09-09 04:46:40.000000000 +0300
+++ hgeometry-0.12.0.4/src/Data/Geometry/Vector/VectorFamilyPeano.hs	2021-09-01 22:40:02.606094114 +0300
@@ -215,7 +215,7 @@
   {-# INLINE rnf #-}
 
 
-instance (ImplicitPeano d, Hashable r) => Hashable (VectorFamily d r) where
+instance (ImplicitArity d, Hashable r) => Hashable (VectorFamily d r) where
   hashWithSalt = case (implicitPeano :: SingPeano d) of
                    SZ                         -> hashWithSalt
                    (SS SZ)                    -> hashWithSalt

reanimate

--- orig/reanimate-1.1.4.0/src/Reanimate/Math/Polygon.hs	2001-09-09 04:46:40.000000000 +0300
+++ reanimate-1.1.4.0/src/Reanimate/Math/Polygon.hs	2021-09-01 22:58:47.156589907 +0300
@@ -116,6 +116,7 @@
   , polygonTriangulation :: Triangulation
   , polygonSSSP          :: Vector SSSP
   }
+  deriving Eq
 type Polygon = APolygon Rational
 type P = V2 Double

This was referenced Nov 1, 2021
@istathar
Copy link
Contributor

istathar commented Nov 1, 2021

Cleared upper bound from core-data, aesiniath/unbeliever@5ab32bd

@bergmark Stupid question, sorry, but is this for nightly or lts-18? If so I'll do a point release for the previous version as well.

@bergmark
Copy link
Member Author

bergmark commented Nov 1, 2021

Nice work @phadej!

@istathar issues in this repo are for nightly unless otherwise noted. We normally don't upgrade major versions in LTS, so LTS 18 will keep using hashable 1.3.x. You shouldn't need to backport anything four our sake.

@mrkkrp
Copy link
Contributor

mrkkrp commented Nov 1, 2021

Allowed hashable-1.4.0.0 for mmark-0.0.7.3 via a revision.

@sjakobi
Copy link
Member

sjakobi commented Nov 3, 2021

@bergmark Please note that several maintainers did not yet receive a ping from this issue due to GitHub's rate limiting.

@bergmark
Copy link
Member Author

bergmark commented Nov 6, 2021

@MichelBoucey
Copy link
Contributor

Waiting for unordered-containers to be updated...

@facundominguez
Copy link
Contributor

Allowed hashable-1.4.0.0 for network-transport-0.5.4 with a new revision.

@ppelleti
Copy link
Contributor

ppelleti commented Nov 8, 2021

Updated mercury-api-0.1.0.2 and normalization-insensitive-2.0.2 via a revision.

@fumieval
Copy link
Contributor

fumieval commented Nov 9, 2021

Updated witherable's constraint: https://hackage.haskell.org/package/witherable-0.4.2/revisions/

@sjakobi
Copy link
Member

sjakobi commented Nov 9, 2021

I've just uploaded unordered-containers-0.2.15.0, which supports hashable-1.4.

@neongreen
Copy link
Contributor

Uploaded new microlens-platform.

Btw should I write a comment when I fix a package after being pinged, or is it just noise?

@phadej
Copy link
Contributor

phadej commented Nov 10, 2021

IMO it is noisy, as everyone whoe have not yet unsubscribed is pinged.

Gabriella439 added a commit to dhall-lang/dhall-haskell that referenced this issue Nov 10, 2021
maksbotan added a commit to biocad/openapi3 that referenced this issue Nov 10, 2021
Gabriella439 added a commit to dhall-lang/dhall-haskell that referenced this issue Nov 11, 2021
@MichelBoucey
Copy link
Contributor

That's OK in gothic-0.1.8.

@chris-martin
Copy link
Contributor

I believe I got all mine updated a week ago, are the checkboxes in the top comment supposed to get ticked off automatically?

@bergmark
Copy link
Member Author

No we do that manually when we get bored 🤷

@juhp
Copy link
Contributor

juhp commented Nov 24, 2021

Perhaps I should update the list - I think there has been a fair bit of movement, though still quite a few remain I believe

Gabriella439 added a commit to Gabriella439/foldl that referenced this issue Nov 29, 2021
@andreasabel
Copy link
Contributor

Agda 2.6.2.1 supports hashable-1.4.

@fosskers
Copy link
Contributor

fosskers commented Dec 8, 2021

Aura should be good to go.

@juhp
Copy link
Contributor

juhp commented Dec 27, 2021

Thank you to everyone who updated their packages already.

I have just completely refreshed the current list of problem packages in the description now.

@debug-ito
Copy link
Contributor

greskell and greskell-core now support hashable 1.4

@Vlix
Copy link
Contributor

Vlix commented Dec 28, 2021

Revised safe-json

@martijnbastiaan
Copy link
Contributor

Sorry it's taking so long for the clash-* packages. The Eq a => Hashable a change turned out to uncover a flurry of bugs..

@freizl
Copy link
Contributor

freizl commented Jan 1, 2022

hoauth2-1.16.1

@juhp
Copy link
Contributor

juhp commented Jan 7, 2022

I think this was closed prematurely if I am not mistaken, so re-opening

@juhp juhp reopened this Jan 7, 2022
@martijnbastiaan
Copy link
Contributor

clash-{prelude,lib,ghc}-1.4.7 support hashable-1.4.0.0

@Daniel-Diaz
Copy link
Contributor

HaTeX accepts hashable-1.4 now.

@juhp
Copy link
Contributor

juhp commented Feb 12, 2022

I have refreshed the data in the initial description so it is now current with nightly-2022-02-12,
now that aeson-2.0 has been merged in Nightly.

@bergmark
Copy link
Member Author

We're closing this since we upgraded to GHC 9.2.2. Packages that hadn't been updated have been disabled. If so, they are listed in #6486.

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.