commit ghc-unordered-containers for openSUSE:Factory
Hello community,
here is the log from the commit of package ghc-unordered-containers for openSUSE:Factory checked in at 2018-05-30 12:15:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-unordered-containers (Old)
and /work/SRC/openSUSE:Factory/.ghc-unordered-containers.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-unordered-containers"
Wed May 30 12:15:43 2018 rev:12 rq:607918 version:0.2.9.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-unordered-containers/ghc-unordered-containers.changes 2017-09-15 22:22:09.312858270 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-unordered-containers.new/ghc-unordered-containers.changes 2018-05-30 12:27:47.213272088 +0200
@@ -1,0 +2,21 @@
+Mon May 14 17:02:11 UTC 2018 - psimons@suse.com
+
+- Update unordered-containers to version 0.2.9.0.
+
+ * Add `Ord/Ord1/Ord2` instances. (Thanks, Oleg Grenrus)
+
+ * Use `SmallArray#` instead of `Array#` for GHC versions 7.10 and above.
+ (Thanks, Dmitry Ivanov)
+
+ * Adjust for `Semigroup => Monoid` proposal implementation.
+ (Thanks, Ryan Scott)
+
+ * Fix a strictness bug in `fromListWith`.
+
+ * Enable eager blackholing for pre-8.2 GHC versions to work around
+ a runtime system bug. (Thanks, Ben Gamari)
+
+ * Avoid sketchy reimplementation of `ST` when compiling with recent
+ GHC.
+
+-------------------------------------------------------------------
Old:
----
unordered-containers-0.2.8.0.tar.gz
New:
----
unordered-containers-0.2.9.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-unordered-containers.spec ++++++
--- /var/tmp/diff_new_pack.ZIHK2u/_old 2018-05-30 12:27:47.909247647 +0200
+++ /var/tmp/diff_new_pack.ZIHK2u/_new 2018-05-30 12:27:47.913247507 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-unordered-containers
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%global pkg_name unordered-containers
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.2.8.0
+Version: 0.2.9.0
Release: 0
Summary: Efficient hashing-based container types
License: BSD-3-Clause
@@ -79,7 +79,7 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
%doc CHANGES.md
++++++ unordered-containers-0.2.8.0.tar.gz -> unordered-containers-0.2.9.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/CHANGES.md new/unordered-containers-0.2.9.0/CHANGES.md
--- old/unordered-containers-0.2.8.0/CHANGES.md 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/CHANGES.md 2018-02-05 18:10:45.000000000 +0100
@@ -1,3 +1,29 @@
+## 0.2.9.0
+
+ * Add `Ord/Ord1/Ord2` instances. (Thanks, Oleg Grenrus)
+
+ * Use `SmallArray#` instead of `Array#` for GHC versions 7.10 and above.
+ (Thanks, Dmitry Ivanov)
+
+ * Adjust for `Semigroup => Monoid` proposal implementation.
+ (Thanks, Ryan Scott)
+
+### Bug fixes
+
+ * Fix a strictness bug in `fromListWith`.
+
+ * Enable eager blackholing for pre-8.2 GHC versions to work around
+ a runtime system bug. (Thanks, Ben Gamari)
+
+ * Avoid sketchy reimplementation of `ST` when compiling with recent
+ GHC.
+
+### Other changes
+
+ * Remove support for GHC versions before 7.8. (Thanks, Dmitry Ivanov)
+
+ * Add internal documentaton. (Thanks, Johan Tibell)
+
## 0.2.8.0
* Add `Eq1/2`, `Show1/2`, `Read1` instances with `base-4.9`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/Data/HashMap/Array.hs new/unordered-containers-0.2.9.0/Data/HashMap/Array.hs
--- old/unordered-containers-0.2.8.0/Data/HashMap/Array.hs 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/Data/HashMap/Array.hs 2018-02-05 18:10:45.000000000 +0100
@@ -53,12 +53,7 @@
import Control.Applicative (Applicative)
#endif
import Control.DeepSeq
--- GHC 7.7 exports toList/fromList from GHC.Exts
--- In order to avoid warnings on previous GHC versions, we provide
--- an explicit import list instead of only hiding the offending symbols
-import GHC.Exts (Array#, Int(..), newArray#, readArray#, writeArray#,
- indexArray#, unsafeFreezeArray#, unsafeThawArray#,
- MutableArray#)
+import GHC.Exts(Int(..))
import GHC.ST (ST(..))
#if __GLASGOW_HASKELL__ >= 709
@@ -67,9 +62,17 @@
import Prelude hiding (filter, foldr, length, map, read)
#endif
-#if __GLASGOW_HASKELL__ >= 702
-import GHC.Exts (sizeofArray#, copyArray#, thawArray#, sizeofMutableArray#,
- copyMutableArray#)
+#if __GLASGOW_HASKELL__ >= 710
+import GHC.Exts (SmallArray#, newSmallArray#, readSmallArray#, writeSmallArray#,
+ indexSmallArray#, unsafeFreezeSmallArray#, unsafeThawSmallArray#,
+ SmallMutableArray#, sizeofSmallArray#, copySmallArray#, thawSmallArray#,
+ sizeofSmallMutableArray#, copySmallMutableArray#)
+
+#else
+import GHC.Exts (Array#, newArray#, readArray#, writeArray#,
+ indexArray#, unsafeFreezeArray#, unsafeThawArray#,
+ MutableArray#, sizeofArray#, copyArray#, thawArray#,
+ sizeofMutableArray#, copyMutableArray#)
#endif
#if defined(ASSERTS)
@@ -78,6 +81,24 @@
import Data.HashMap.Unsafe (runST)
+
+#if __GLASGOW_HASKELL__ >= 710
+type Array# a = SmallArray# a
+type MutableArray# a = SmallMutableArray# a
+
+newArray# = newSmallArray#
+readArray# = readSmallArray#
+writeArray# = writeSmallArray#
+indexArray# = indexSmallArray#
+unsafeFreezeArray# = unsafeFreezeSmallArray#
+unsafeThawArray# = unsafeThawSmallArray#
+sizeofArray# = sizeofSmallArray#
+copyArray# = copySmallArray#
+thawArray# = thawSmallArray#
+sizeofMutableArray# = sizeofSmallMutableArray#
+copyMutableArray# = copySmallMutableArray#
+#endif
+
------------------------------------------------------------------------
#if defined(ASSERTS)
@@ -100,49 +121,31 @@
data Array a = Array {
unArray :: !(Array# a)
-#if __GLASGOW_HASKELL__ < 702
- , length :: !Int
-#endif
}
instance Show a => Show (Array a) where
show = show . toList
-#if __GLASGOW_HASKELL__ >= 702
length :: Array a -> Int
length ary = I# (sizeofArray# (unArray ary))
{-# INLINE length #-}
-#endif
-- | Smart constructor
array :: Array# a -> Int -> Array a
-#if __GLASGOW_HASKELL__ >= 702
array ary _n = Array ary
-#else
-array = Array
-#endif
{-# INLINE array #-}
data MArray s a = MArray {
unMArray :: !(MutableArray# s a)
-#if __GLASGOW_HASKELL__ < 702
- , lengthM :: !Int
-#endif
}
-#if __GLASGOW_HASKELL__ >= 702
lengthM :: MArray s a -> Int
lengthM mary = I# (sizeofMutableArray# (unMArray mary))
{-# INLINE lengthM #-}
-#endif
-- | Smart constructor
marray :: MutableArray# s a -> Int -> MArray s a
-#if __GLASGOW_HASKELL__ >= 702
marray mary _n = MArray mary
-#else
-marray = MArray
-#endif
{-# INLINE marray #-}
------------------------------------------------------------------------
@@ -237,47 +240,21 @@
-- | Unsafely copy the elements of an array. Array bounds are not checked.
copy :: Array e -> Int -> MArray s e -> Int -> Int -> ST s ()
-#if __GLASGOW_HASKELL__ >= 702
copy !src !_sidx@(I# sidx#) !dst !_didx@(I# didx#) _n@(I# n#) =
CHECK_LE("copy", _sidx + _n, length src)
CHECK_LE("copy", _didx + _n, lengthM dst)
ST $ \ s# ->
case copyArray# (unArray src) sidx# (unMArray dst) didx# n# s# of
s2 -> (# s2, () #)
-#else
-copy !src !sidx !dst !didx n =
- CHECK_LE("copy", sidx + n, length src)
- CHECK_LE("copy", didx + n, lengthM dst)
- copy_loop sidx didx 0
- where
- copy_loop !i !j !c
- | c >= n = return ()
- | otherwise = do b <- indexM src i
- write dst j b
- copy_loop (i+1) (j+1) (c+1)
-#endif
-- | Unsafely copy the elements of an array. Array bounds are not checked.
copyM :: MArray s e -> Int -> MArray s e -> Int -> Int -> ST s ()
-#if __GLASGOW_HASKELL__ >= 702
copyM !src !_sidx@(I# sidx#) !dst !_didx@(I# didx#) _n@(I# n#) =
CHECK_BOUNDS("copyM: src", lengthM src, _sidx + _n - 1)
CHECK_BOUNDS("copyM: dst", lengthM dst, _didx + _n - 1)
ST $ \ s# ->
case copyMutableArray# (unMArray src) sidx# (unMArray dst) didx# n# s# of
s2 -> (# s2, () #)
-#else
-copyM !src !sidx !dst !didx n =
- CHECK_BOUNDS("copyM: src", lengthM src, sidx + n - 1)
- CHECK_BOUNDS("copyM: dst", lengthM dst, didx + n - 1)
- copy_loop sidx didx 0
- where
- copy_loop !i !j !c
- | c >= n = return ()
- | otherwise = do b <- read src i
- write dst j b
- copy_loop (i+1) (j+1) (c+1)
-#endif
-- | /O(n)/ Insert an element at the given position in this array,
-- increasing its size by one.
@@ -352,18 +329,10 @@
{-# NOINLINE undefinedElem #-}
thaw :: Array e -> Int -> Int -> ST s (MArray s e)
-#if __GLASGOW_HASKELL__ >= 702
thaw !ary !_o@(I# o#) !n@(I# n#) =
CHECK_LE("thaw", _o + n, length ary)
ST $ \ s -> case thawArray# (unArray ary) o# n# s of
(# s2, mary# #) -> (# s2, marray mary# n #)
-#else
-thaw !ary !o !n =
- CHECK_LE("thaw", o + n, length ary)
- do mary <- new_ n
- copy ary o mary 0 n
- return mary
-#endif
{-# INLINE thaw #-}
-- | /O(n)/ Delete an element at the given position in this array,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/Data/HashMap/Base.hs new/unordered-containers-0.2.9.0/Data/HashMap/Base.hs
--- old/unordered-containers-0.2.8.0/Data/HashMap/Base.hs 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/Data/HashMap/Base.hs 2018-02-05 18:10:45.000000000 +0100
@@ -1,10 +1,8 @@
{-# LANGUAGE BangPatterns, CPP, DeriveDataTypeable, MagicHash #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PatternGuards #-}
-#if __GLASGOW_HASKELL__ >= 708
{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE TypeFamilies #-}
-#endif
{-# OPTIONS_GHC -fno-full-laziness -funbox-strict-fields #-}
module Data.HashMap.Base
@@ -104,7 +102,7 @@
#endif
import Control.DeepSeq (NFData(rnf))
import Control.Monad.ST (ST)
-import Data.Bits ((.&.), (.|.), complement)
+import Data.Bits ((.&.), (.|.), complement, popCount)
import Data.Data hiding (Typeable)
import qualified Data.Foldable as Foldable
import qualified Data.List as L
@@ -115,17 +113,13 @@
import qualified Data.HashMap.Array as A
import qualified Data.Hashable as H
import Data.Hashable (Hashable)
-import Data.HashMap.PopCount (popCount)
import Data.HashMap.Unsafe (runST)
import Data.HashMap.UnsafeShift (unsafeShiftL, unsafeShiftR)
+import Data.HashMap.List (isPermutationBy, unorderedCompare)
import Data.Typeable (Typeable)
-#if __GLASGOW_HASKELL__ >= 707
import GHC.Exts (isTrue#)
-#endif
-#if __GLASGOW_HASKELL__ >= 708
import qualified GHC.Exts as Exts
-#endif
#if MIN_VERSION_base(4,9,0)
import Data.Functor.Classes
@@ -161,9 +155,7 @@
| Collision !Hash !(A.Array (Leaf k v))
deriving (Typeable)
-#if __GLASGOW_HASKELL__ >= 708
type role HashMap nominal representational
-#endif
instance (NFData k, NFData v) => NFData (HashMap k v) where
rnf Empty = ()
@@ -267,10 +259,12 @@
-- order of elements in 'Collision').
go (Leaf k1 l1 : tl1) (Leaf k2 l2 : tl2)
- | k1 == k2 && leafEq l1 l2
+ | k1 == k2 &&
+ leafEq l1 l2
= go tl1 tl2
go (Collision k1 ary1 : tl1) (Collision k2 ary2 : tl2)
- | k1 == k2 && A.length ary1 == A.length ary2 &&
+ | k1 == k2 &&
+ A.length ary1 == A.length ary2 &&
isPermutationBy leafEq (A.toList ary1) (A.toList ary2)
= go tl1 tl2
go [] [] = True
@@ -278,26 +272,43 @@
leafEq (L k v) (L k' v') = eqk k k' && eqv v v'
--- Note: previous implemenation isPermutation = null (as // bs)
--- was O(n^2) too.
+#if MIN_VERSION_base(4,9,0)
+instance Ord2 HashMap where
+ liftCompare2 = cmp
+
+instance Ord k => Ord1 (HashMap k) where
+ liftCompare = cmp compare
+#endif
+
+-- | The order is total.
--
--- This assumes lists are of equal length
-isPermutationBy :: (a -> b -> Bool) -> [a] -> [b] -> Bool
-isPermutationBy f = go
+-- /Note:/ Because the hash is not guaranteed to be stable across library
+-- versions, OSes, or architectures, neither is an actual order of elements in
+-- 'HashMap' or an result of `compare`.is stable.
+instance (Ord k, Ord v) => Ord (HashMap k v) where
+ compare = cmp compare compare
+
+cmp :: (k -> k' -> Ordering) -> (v -> v' -> Ordering)
+ -> HashMap k v -> HashMap k' v' -> Ordering
+cmp cmpk cmpv t1 t2 = go (toList' t1 []) (toList' t2 [])
where
- f' = flip f
+ go (Leaf k1 l1 : tl1) (Leaf k2 l2 : tl2)
+ = compare k1 k2 `mappend`
+ leafCompare l1 l2 `mappend`
+ go tl1 tl2
+ go (Collision k1 ary1 : tl1) (Collision k2 ary2 : tl2)
+ = compare k1 k2 `mappend`
+ compare (A.length ary1) (A.length ary2) `mappend`
+ unorderedCompare leafCompare (A.toList ary1) (A.toList ary2) `mappend`
+ go tl1 tl2
+ go (Leaf _ _ : _) (Collision _ _ : _) = LT
+ go (Collision _ _ : _) (Leaf _ _ : _) = GT
+ go [] [] = EQ
+ go [] _ = LT
+ go _ [] = GT
+ go _ _ = error "cmp: Should never happend, toList' includes non Leaf / Collision"
- go [] [] = True
- go (x : xs) (y : ys)
- | f x y = go xs ys
- | otherwise = go (deleteBy f' y xs) (deleteBy f x ys)
- go [] (_ : _) = False
- go (_ : _) [] = False
-
--- Data.List.deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
-deleteBy :: (a -> b -> Bool) -> a -> [b] -> [b]
-deleteBy _ _ [] = []
-deleteBy eq x (y:ys) = if x `eq` y then ys else y : deleteBy eq x ys
+ leafCompare (L k v) (L k' v') = cmpk k k' `mappend` cmpv v v'
-- Same as 'equal' but doesn't compare the values.
equalKeys :: (k -> k' -> Bool) -> HashMap k v -> HashMap k' v' -> Bool
@@ -1299,28 +1310,7 @@
-- array is not checked.
clone16 :: A.Array e -> ST s (A.MArray s e)
clone16 ary =
-#if __GLASGOW_HASKELL__ >= 702
A.thaw ary 0 16
-#else
- do mary <- A.new_ 16
- A.indexM ary 0 >>= A.write mary 0
- A.indexM ary 1 >>= A.write mary 1
- A.indexM ary 2 >>= A.write mary 2
- A.indexM ary 3 >>= A.write mary 3
- A.indexM ary 4 >>= A.write mary 4
- A.indexM ary 5 >>= A.write mary 5
- A.indexM ary 6 >>= A.write mary 6
- A.indexM ary 7 >>= A.write mary 7
- A.indexM ary 8 >>= A.write mary 8
- A.indexM ary 9 >>= A.write mary 9
- A.indexM ary 10 >>= A.write mary 10
- A.indexM ary 11 >>= A.write mary 11
- A.indexM ary 12 >>= A.write mary 12
- A.indexM ary 13 >>= A.write mary 13
- A.indexM ary 14 >>= A.write mary 14
- A.indexM ary 15 >>= A.write mary 15
- return mary
-#endif
------------------------------------------------------------------------
-- Bit twiddling
@@ -1355,18 +1345,12 @@
-- | Check if two the two arguments are the same value. N.B. This
-- function might give false negatives (due to GC moving objects.)
ptrEq :: a -> a -> Bool
-#if __GLASGOW_HASKELL__ < 707
-ptrEq x y = reallyUnsafePtrEquality# x y ==# 1#
-#else
ptrEq x y = isTrue# (reallyUnsafePtrEquality# x y ==# 1#)
-#endif
{-# INLINE ptrEq #-}
-#if __GLASGOW_HASKELL__ >= 708
------------------------------------------------------------------------
-- IsList instance
instance (Eq k, Hashable k) => Exts.IsList (HashMap k v) where
type Item (HashMap k v) = (k, v)
fromList = fromList
toList = toList
-#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/Data/HashMap/Lazy.hs new/unordered-containers-0.2.9.0/Data/HashMap/Lazy.hs
--- old/unordered-containers-0.2.8.0/Data/HashMap/Lazy.hs 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/Data/HashMap/Lazy.hs 2018-02-05 18:10:45.000000000 +0100
@@ -1,8 +1,5 @@
{-# LANGUAGE CPP #-}
-
-#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
-#endif
------------------------------------------------------------------------
-- |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/Data/HashMap/List.hs new/unordered-containers-0.2.9.0/Data/HashMap/List.hs
--- old/unordered-containers-0.2.8.0/Data/HashMap/List.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/unordered-containers-0.2.9.0/Data/HashMap/List.hs 2018-02-05 18:10:45.000000000 +0100
@@ -0,0 +1,66 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# OPTIONS_GHC -fno-full-laziness -funbox-strict-fields #-}
+-- | Extra list functions
+--
+-- In separate module to aid testing.
+module Data.HashMap.List
+ ( isPermutationBy
+ , deleteBy
+ , unorderedCompare
+ ) where
+
+import Data.Maybe (fromMaybe)
+import Data.List (sortBy)
+import Data.Monoid
+import Prelude
+
+-- Note: previous implemenation isPermutation = null (as // bs)
+-- was O(n^2) too.
+--
+-- This assumes lists are of equal length
+isPermutationBy :: (a -> b -> Bool) -> [a] -> [b] -> Bool
+isPermutationBy f = go
+ where
+ f' = flip f
+
+ go [] [] = True
+ go (x : xs) (y : ys)
+ | f x y = go xs ys
+ | otherwise = fromMaybe False $ do
+ xs' <- deleteBy f' y xs
+ ys' <- deleteBy f x ys
+ return (go xs' ys')
+ go [] (_ : _) = False
+ go (_ : _) [] = False
+
+-- The idea:
+--
+-- Homogeonous version
+--
+-- uc :: (a -> a -> Ordering) -> [a] -> [a] -> Ordering
+-- uc c as bs = compare (sortBy c as) (sortBy c bs)
+--
+-- But as we have only (a -> b -> Ordering), we cannot directly compare
+-- elements from the same list.
+--
+-- So when comparing elements from the list, we count how many elements are
+-- "less and greater" in the other list, and use the count as a metric.
+--
+unorderedCompare :: (a -> b -> Ordering) -> [a] -> [b] -> Ordering
+unorderedCompare c as bs = go (sortBy cmpA as) (sortBy cmpB bs)
+ where
+ go [] [] = EQ
+ go [] (_ : _) = LT
+ go (_ : _) [] = GT
+ go (x : xs) (y : ys) = c x y `mappend` go xs ys
+
+ cmpA a a' = compare (inB a) (inB a')
+ cmpB b b' = compare (inA b) (inA b')
+
+ inB a = (length $ filter (\b -> c a b == GT) bs, negate $ length $ filter (\b -> c a b == LT) bs)
+ inA b = (length $ filter (\a -> c a b == LT) as, negate $ length $ filter (\a -> c a b == GT) as)
+
+-- Returns Nothing is nothing deleted
+deleteBy :: (a -> b -> Bool) -> a -> [b] -> Maybe [b]
+deleteBy _ _ [] = Nothing
+deleteBy eq x (y:ys) = if x `eq` y then Just ys else fmap (y :) (deleteBy eq x ys)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/Data/HashMap/PopCount.hs new/unordered-containers-0.2.9.0/Data/HashMap/PopCount.hs
--- old/unordered-containers-0.2.8.0/Data/HashMap/PopCount.hs 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/Data/HashMap/PopCount.hs 1970-01-01 01:00:00.000000000 +0100
@@ -1,19 +0,0 @@
-{-# LANGUAGE CPP, ForeignFunctionInterface #-}
-
-module Data.HashMap.PopCount
- ( popCount
- ) where
-
-#if __GLASGOW_HASKELL__ >= 704
-import Data.Bits (popCount)
-#else
-import Data.Word (Word)
-import Foreign.C (CUInt)
-#endif
-
-#if __GLASGOW_HASKELL__ < 704
-foreign import ccall unsafe "popc.h popcount" c_popcount :: CUInt -> CUInt
-
-popCount :: Word -> Int
-popCount w = fromIntegral (c_popcount (fromIntegral w))
-#endif
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/Data/HashMap/Strict.hs new/unordered-containers-0.2.9.0/Data/HashMap/Strict.hs
--- old/unordered-containers-0.2.8.0/Data/HashMap/Strict.hs 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/Data/HashMap/Strict.hs 2018-02-05 18:10:45.000000000 +0100
@@ -1,8 +1,5 @@
{-# LANGUAGE BangPatterns, CPP, PatternGuards #-}
-
-#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
-#endif
------------------------------------------------------------------------
-- |
@@ -183,7 +180,7 @@
else do
let l' = x `seq` (L k x)
return $! collision h l l'
- | otherwise = two s h k x hy ky y
+ | otherwise = x `seq` two s h k x hy ky y
go h k x s t@(BitmapIndexed b ary)
| b .&. m == 0 = do
ary' <- A.insertM ary i $! leaf h k x
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/Data/HashMap/Unsafe.hs new/unordered-containers-0.2.9.0/Data/HashMap/Unsafe.hs
--- old/unordered-containers-0.2.8.0/Data/HashMap/Unsafe.hs 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/Data/HashMap/Unsafe.hs 2018-02-05 18:10:45.000000000 +0100
@@ -1,4 +1,8 @@
+{-# LANGUAGE CPP #-}
+
+#if !MIN_VERSION_base(4,9,0)
{-# LANGUAGE MagicHash, Rank2Types, UnboxedTuples #-}
+#endif
-- | This module exports a workaround for this bug:
--
@@ -12,6 +16,12 @@
( runST
) where
+#if MIN_VERSION_base(4,9,0)
+-- The GHC issue was fixed in GHC 8.0/base 4.9
+import Control.Monad.ST
+
+#else
+
import GHC.Base (realWorld#)
import qualified GHC.ST as ST
@@ -26,3 +36,4 @@
runSTRep st_rep = case st_rep realWorld# of
(# _, r #) -> r
{-# INLINE [0] runSTRep #-}
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/Data/HashSet.hs new/unordered-containers-0.2.9.0/Data/HashSet.hs
--- old/unordered-containers-0.2.8.0/Data/HashSet.hs 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/Data/HashSet.hs 2018-02-05 18:10:45.000000000 +0100
@@ -77,7 +77,7 @@
import Data.HashMap.Base (HashMap, foldrWithKey, equalKeys)
import Data.Hashable (Hashable(hashWithSalt))
#if __GLASGOW_HASKELL__ >= 711
-import Data.Semigroup (Semigroup(..), Monoid(..))
+import Data.Semigroup (Semigroup(..))
#elif __GLASGOW_HASKELL__ < 709
import Data.Monoid (Monoid(..))
#endif
@@ -123,6 +123,15 @@
liftEq eq (HashSet a) (HashSet b) = equalKeys eq a b
#endif
+instance (Ord a) => Ord (HashSet a) where
+ compare (HashSet a) (HashSet b) = compare a b
+ {-# INLINE compare #-}
+
+#if MIN_VERSION_base(4,9,0)
+instance Ord1 HashSet where
+ liftCompare c (HashSet a) (HashSet b) = liftCompare2 c compare a b
+#endif
+
instance Foldable.Foldable HashSet where
foldr = Data.HashSet.foldr
{-# INLINE foldr #-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/cbits/popc.c new/unordered-containers-0.2.9.0/cbits/popc.c
--- old/unordered-containers-0.2.8.0/cbits/popc.c 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/cbits/popc.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,273 +0,0 @@
-#include
participants (1)
-
root