Hello community, here is the log from the commit of package ghc-hashable for openSUSE:Factory checked in at 2016-01-20 09:54:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-hashable (Old) and /work/SRC/openSUSE:Factory/.ghc-hashable.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-hashable" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-hashable/ghc-hashable.changes 2015-06-30 10:19:04.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-hashable.new/ghc-hashable.changes 2016-01-20 09:54:55.000000000 +0100 @@ -1,0 +2,7 @@ +Sun Jan 17 10:13:24 UTC 2016 - mimi.vx@gmail.com + +- update to 1.2.4.0 +* Add instances for: Unique, Version, Fixed, NonEmpty, Min, Max, Arg, + First, Last, WrappedMonoid, Option + +------------------------------------------------------------------- Old: ---- hashable-1.2.3.3.tar.gz New: ---- hashable-1.2.4.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-hashable.spec ++++++ --- /var/tmp/diff_new_pack.9y6nja/_old 2016-01-20 09:54:57.000000000 +0100 +++ /var/tmp/diff_new_pack.9y6nja/_new 2016-01-20 09:54:57.000000000 +0100 @@ -19,7 +19,7 @@ %global pkg_name hashable Name: ghc-hashable -Version: 1.2.3.3 +Version: 1.2.4.0 Release: 0 Summary: A class for types that can be converted to a hash value License: BSD-3-Clause ++++++ hashable-1.2.3.3.tar.gz -> hashable-1.2.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hashable-1.2.3.3/CHANGES.md new/hashable-1.2.4.0/CHANGES.md --- old/hashable-1.2.3.3/CHANGES.md 2015-06-26 08:04:55.000000000 +0200 +++ new/hashable-1.2.4.0/CHANGES.md 2016-01-14 20:32:59.000000000 +0100 @@ -1,3 +1,10 @@ +## Version 1.2.4.0 + + * Add instances for: Unique, Version, Fixed, NonEmpty, Min, Max, Arg, + First, Last, WrappedMonoid, Option + + * Support GHC 8.0 + ## Version 1.2.3.3 * Support integer-simple. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hashable-1.2.3.3/Data/Hashable/Class.hs new/hashable-1.2.4.0/Data/Hashable/Class.hs --- old/hashable-1.2.3.3/Data/Hashable/Class.hs 2015-06-26 08:04:55.000000000 +0200 +++ new/hashable-1.2.4.0/Data/Hashable/Class.hs 2016-01-14 20:32:59.000000000 +0100 @@ -38,7 +38,7 @@ ) where import Control.Exception (assert) -import Data.Bits (bitSize, shiftL, shiftR, xor) +import Data.Bits (shiftL, shiftR, xor) import qualified Data.ByteString as B import qualified Data.ByteString.Internal as B import qualified Data.ByteString.Lazy as BL @@ -51,7 +51,8 @@ import qualified Data.Text.Internal as T import qualified Data.Text.Lazy as TL import Data.Typeable -import Data.Word (Word, Word8, Word16, Word32, Word64) +import Data.Version (Version(..)) +import Data.Word (Word8, Word16, Word32, Word64) import Foreign.C (CString) import Foreign.Marshal.Utils (with) import Foreign.Ptr (Ptr, castPtr) @@ -61,6 +62,11 @@ import GHC.Prim (ThreadId#) import System.IO.Unsafe (unsafePerformIO) import System.Mem.StableName +import Data.Unique (Unique, hashUnique) + +#if MIN_VERSION_base(4,7,0) +import Data.Fixed (Fixed(..)) +#endif #ifdef GENERICS import GHC.Generics @@ -81,7 +87,17 @@ import Foreign.C.Types (CInt) #endif -#if !MIN_VERSION_bytestring(0,10,0) +#if !(MIN_VERSION_base(4,8,0)) +import Data.Word (Word) +#endif + +#if MIN_VERSION_base(4,7,0) +import Data.Bits (finiteBitSize) +#else +import Data.Bits (bitSize) +#endif + +#if !(MIN_VERSION_bytestring(0,10,0)) import qualified Data.ByteString.Lazy.Internal as BL -- foldlChunks #endif @@ -109,6 +125,11 @@ import GHC.Exts (Word(..)) #endif +#if MIN_VERSION_base(4,9,0) +import qualified Data.List.NonEmpty as NE +import Data.Semigroup +#endif + #include "MachDeps.h" infixl 0 `hashWithSalt` @@ -215,7 +236,11 @@ instance Hashable Int64 where hash n +#if MIN_VERSION_base(4,7,0) + | finiteBitSize (undefined :: Int) == 64 = fromIntegral n +#else | bitSize (undefined :: Int) == 64 = fromIntegral n +#endif | otherwise = fromIntegral (fromIntegral n `xor` (fromIntegral n `shiftR` 32 :: Word64)) hashWithSalt = defaultHashWithSalt @@ -238,7 +263,11 @@ instance Hashable Word64 where hash n +#if MIN_VERSION_base(4,7,0) + | finiteBitSize (undefined :: Int) == 64 = fromIntegral n +#else | bitSize (undefined :: Int) == 64 = fromIntegral n +#endif | otherwise = fromIntegral (n `xor` (n `shiftR` 32)) hashWithSalt = defaultHashWithSalt @@ -322,7 +351,12 @@ inBounds x = x >= fromIntegral (minBound :: Int) && x <= maxInt #endif +#if MIN_VERSION_base(4,9,0) +-- Starting with base-4.9, numerator/denominator don't need 'Integral' anymore +instance Hashable a => Hashable (Ratio a) where +#else instance (Integral a, Hashable a) => Hashable (Ratio a) where +#endif {-# SPECIALIZE instance Hashable (Ratio Integer) #-} hash a = hash (numerator a) `hashWithSalt` denominator a hashWithSalt s a = s `hashWithSalt` numerator a `hashWithSalt` denominator a @@ -412,9 +446,15 @@ hash = hashStableName hashWithSalt = defaultHashWithSalt +-- Auxillary type for Hashable [a] definition +data SPInt = SP !Int !Int + instance Hashable a => Hashable [a] where {-# SPECIALIZE instance Hashable [Char] #-} - hashWithSalt = foldl' hashWithSalt + hashWithSalt salt arr = finalise (foldl' step (SP salt 0) arr) + where + finalise (SP s l) = hashWithSalt s l + step (SP s l) x = SP (hashWithSalt s x) (l + 1) instance Hashable B.ByteString where hashWithSalt salt bs = B.inlinePerformIO $ @@ -533,3 +573,43 @@ -- identity. combine :: Int -> Int -> Int combine h1 h2 = (h1 * 16777619) `xor` h2 + +instance Hashable Unique where + hash = hashUnique + hashWithSalt = defaultHashWithSalt + +instance Hashable Version where + hashWithSalt salt (Version branch tags) = + salt `hashWithSalt` branch `hashWithSalt` tags + +#if MIN_VERSION_base(4,7,0) +instance Hashable (Fixed a) where + hashWithSalt salt (MkFixed i) = hashWithSalt salt i +#endif + +-- instances formerly provided by 'semigroups' package +#if MIN_VERSION_base(4,9,0) +instance Hashable a => Hashable (NE.NonEmpty a) where + hashWithSalt p (a NE.:| as) = p `hashWithSalt` a `hashWithSalt` as + +instance Hashable a => Hashable (Min a) where + hashWithSalt p (Min a) = hashWithSalt p a + +instance Hashable a => Hashable (Max a) where + hashWithSalt p (Max a) = hashWithSalt p a + +instance (Hashable a, Hashable b) => Hashable (Arg a b) where + hashWithSalt p (Arg a b) = hashWithSalt p a `hashWithSalt` b + +instance Hashable a => Hashable (First a) where + hashWithSalt p (First a) = hashWithSalt p a + +instance Hashable a => Hashable (Last a) where + hashWithSalt p (Last a) = hashWithSalt p a + +instance Hashable a => Hashable (WrappedMonoid a) where + hashWithSalt p (WrapMonoid a) = hashWithSalt p a + +instance Hashable a => Hashable (Option a) where + hashWithSalt p (Option a) = hashWithSalt p a +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hashable-1.2.3.3/Data/Hashable/Generic.hs new/hashable-1.2.4.0/Data/Hashable/Generic.hs --- old/hashable-1.2.3.3/Data/Hashable/Generic.hs 2015-06-26 08:04:55.000000000 +0200 +++ new/hashable-1.2.4.0/Data/Hashable/Generic.hs 2016-01-14 20:32:59.000000000 +0100 @@ -17,7 +17,7 @@ ( ) where -import Data.Bits (Bits, shiftR) +import Data.Bits (shiftR) import Data.Hashable.Class import GHC.Generics @@ -43,12 +43,11 @@ class GSum f where hashSum :: Int -> Int -> Int -> f a -> Int -instance (GSum a, GSum b, GHashable a, GHashable b, - SumSize a, SumSize b) => GHashable (a :+: b) where +instance (GSum a, GSum b, SumSize a, SumSize b) => GHashable (a :+: b) where ghashWithSalt salt = hashSum salt 0 size where size = unTagged (sumSize :: Tagged (a :+: b)) -instance (GSum a, GSum b, GHashable a, GHashable b) => GSum (a :+: b) where +instance (GSum a, GSum b) => GSum (a :+: b) where hashSum !salt !code !size s = case s of L1 x -> hashSum salt code sizeL x R1 x -> hashSum salt (code + sizeL) sizeR x diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hashable-1.2.3.3/Data/Hashable/SipHash.hs new/hashable-1.2.4.0/Data/Hashable/SipHash.hs --- old/hashable-1.2.3.3/Data/Hashable/SipHash.hs 2015-06-26 08:04:55.000000000 +0200 +++ new/hashable-1.2.4.0/Data/Hashable/SipHash.hs 2016-01-14 20:32:59.000000000 +0100 @@ -153,7 +153,7 @@ return (fromWord64 w) #endif -#if !MIN_VERSION_base(4,5,0) +#if !(MIN_VERSION_base(4,5,0)) unsafeShiftL :: Word64 -> Int -> Word64 unsafeShiftL = shiftL #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hashable-1.2.3.3/benchmarks/Benchmarks.hs new/hashable-1.2.4.0/benchmarks/Benchmarks.hs --- old/hashable-1.2.3.3/benchmarks/Benchmarks.hs 2015-06-26 08:04:55.000000000 +0200 +++ new/hashable-1.2.4.0/benchmarks/Benchmarks.hs 2016-01-14 20:32:59.000000000 +0100 @@ -98,13 +98,13 @@ withForeignPtr fp1Mb $ \ p1Mb -> defaultMain [ bgroup "hashPtr" - [ bench "5" $ hashPtr p5 5 - , bench "8" $ hashPtr p8 8 - , bench "11" $ hashPtr p11 11 - , bench "40" $ hashPtr p40 40 - , bench "128" $ hashPtr p128 128 - , bench "512" $ hashPtr p512 512 - , bench "2^20" $ hashPtr p1Mb mb + [ bench "5" $ whnfIO $ hashPtr p5 5 + , bench "8" $ whnfIO $ hashPtr p8 8 + , bench "11" $ whnfIO $ hashPtr p11 11 + , bench "40" $ whnfIO $ hashPtr p40 40 + , bench "128" $ whnfIO $ hashPtr p128 128 + , bench "512" $ whnfIO $ hashPtr p512 512 + , bench "2^20" $ whnfIO $ hashPtr p1Mb mb ] , bgroup "hashByteArray" [ bench "5" $ whnf (hashByteArray ba5 0) 5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hashable-1.2.3.3/hashable.cabal new/hashable-1.2.4.0/hashable.cabal --- old/hashable-1.2.3.3/hashable.cabal 2015-06-26 08:04:55.000000000 +0200 +++ new/hashable-1.2.4.0/hashable.cabal 2016-01-14 20:32:59.000000000 +0100 @@ -1,5 +1,5 @@ Name: hashable -Version: 1.2.3.3 +Version: 1.2.4.0 Synopsis: A class for types that can be converted to a hash value Description: This package defines a class, 'Hashable', for types that can be converted to a hash value. This class @@ -39,7 +39,7 @@ Library Exposed-modules: Data.Hashable Other-modules: Data.Hashable.Class - Build-depends: base >= 4.0 && < 4.9, + Build-depends: base >= 4.0 && < 4.10, bytestring >= 0.9 && < 0.11 if impl(ghc) Build-depends: ghc-prim, @@ -104,7 +104,7 @@ build-depends: base, bytestring, - criterion, + criterion >= 1.0, ghc-prim, siphash, text