openSUSE Commits
Threads by month
- ----- 2024 -----
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
May 2018
- 1 participants
- 1987 discussions
Hello community,
here is the log from the commit of package ghc-x509 for openSUSE:Factory checked in at 2018-05-30 12:15:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-x509 (Old)
and /work/SRC/openSUSE:Factory/.ghc-x509.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-x509"
Wed May 30 12:15:52 2018 rev:10 rq:607925 version:1.7.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-x509/ghc-x509.changes 2017-08-31 21:01:48.230396550 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-x509.new/ghc-x509.changes 2018-05-30 12:27:55.372985115 +0200
@@ -1,0 +2,6 @@
+Mon May 14 17:02:11 UTC 2018 - psimons(a)suse.com
+
+- Update x509 to version 1.7.3 revision 1.
+ Upstream does not provide a changelog.
+
+-------------------------------------------------------------------
Old:
----
x509-1.7.1.tar.gz
New:
----
x509-1.7.3.tar.gz
x509.cabal
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-x509.spec ++++++
--- /var/tmp/diff_new_pack.EjlWny/_old 2018-05-30 12:27:56.188956369 +0200
+++ /var/tmp/diff_new_pack.EjlWny/_new 2018-05-30 12:27:56.192956228 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-x509
#
-# 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,13 +19,14 @@
%global pkg_name x509
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 1.7.1
+Version: 1.7.3
Release: 0
Summary: X509 reader and writer
License: BSD-3-Clause
-Group: Development/Languages/Other
-Url: https://hackage.haskell.org/package/%{pkg_name}
+Group: Development/Libraries/Haskell
+URL: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
+Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-asn1-encoding-devel
BuildRequires: ghc-asn1-parse-devel
@@ -38,7 +39,6 @@
BuildRequires: ghc-mtl-devel
BuildRequires: ghc-pem-devel
BuildRequires: ghc-rpm-macros
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with tests}
BuildRequires: ghc-tasty-devel
BuildRequires: ghc-tasty-quickcheck-devel
@@ -49,7 +49,7 @@
%package devel
Summary: Haskell %{pkg_name} library development files
-Group: Development/Libraries/Other
+Group: Development/Libraries/Haskell
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
@@ -60,6 +60,7 @@
%prep
%setup -q -n %{pkg_name}-%{version}
+cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
@@ -77,10 +78,8 @@
%ghc_pkg_recache
%files -f %{name}.files
-%defattr(-,root,root,-)
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
-%defattr(-,root,root,-)
%changelog
++++++ x509-1.7.1.tar.gz -> x509-1.7.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-1.7.1/Data/X509/AlgorithmIdentifier.hs new/x509-1.7.3/Data/X509/AlgorithmIdentifier.hs
--- old/x509-1.7.1/Data/X509/AlgorithmIdentifier.hs 2017-06-26 18:12:09.000000000 +0200
+++ new/x509-1.7.3/Data/X509/AlgorithmIdentifier.hs 2017-07-31 22:20:34.000000000 +0200
@@ -95,6 +95,8 @@
Right (oidSig oid, xs)
fromASN1 (Start Sequence:OID [1,2,840,113549,1,1,10]:Start Sequence:Start _:Start Sequence:OID hash1:End Sequence:End _:Start _:Start Sequence:OID [1,2,840,113549,1,1,8]:Start Sequence:OID _hash2:End Sequence:End Sequence:End _:Start _: IntVal _iv: End _: End Sequence : End Sequence:xs) =
Right (oidSig hash1, xs)
+ fromASN1 (Start Sequence:OID [1,2,840,113549,1,1,10]:Start Sequence:Start _:Start Sequence:OID hash1:Null:End Sequence:End _:Start _:Start Sequence:OID [1,2,840,113549,1,1,8]:Start Sequence:OID _hash2:Null:End Sequence:End Sequence:End _:Start _: IntVal _iv: End _: End Sequence : End Sequence:xs) =
+ Right (oidSig hash1, xs)
fromASN1 _ =
Left "fromASN1: X509.SignatureALG: unknown format"
toASN1 signatureAlg@(SignatureALG hashAlg PubKeyALG_RSAPSS) = \xs -> Start Sequence:OID [1,2,840,113549,1,1,10]:Start Sequence:Start (Container Context 0):Start Sequence:OID (sigOID signatureAlg):End Sequence:End (Container Context 0):Start (Container Context 1): Start Sequence:OID [1,2,840,113549,1,1,8]:Start Sequence:OID (sigOID signatureAlg):End Sequence:End Sequence:End (Container Context 1):Start (Container Context 2):IntVal (saltLen hashAlg):End (Container Context 2):End Sequence:End Sequence:xs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-1.7.1/Data/X509/Cert.hs new/x509-1.7.3/Data/X509/Cert.hs
--- old/x509-1.7.1/Data/X509/Cert.hs 2017-06-26 18:12:09.000000000 +0200
+++ new/x509-1.7.3/Data/X509/Cert.hs 2017-07-31 22:17:01.000000000 +0200
@@ -53,7 +53,7 @@
parseCertHeaderVersion :: ParseASN1 Int
parseCertHeaderVersion =
- maybe 1 id <$> onNextContainerMaybe (Container Context 0) (getNext >>= getVer)
+ maybe 0 id <$> onNextContainerMaybe (Container Context 0) (getNext >>= getVer)
where getVer (IntVal v) = return $ fromIntegral v
getVer _ = throwParseError "unexpected type for version"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-1.7.1/Data/X509/DistinguishedName.hs new/x509-1.7.3/Data/X509/DistinguishedName.hs
--- old/x509-1.7.1/Data/X509/DistinguishedName.hs 2017-06-26 18:12:09.000000000 +0200
+++ new/x509-1.7.3/Data/X509/DistinguishedName.hs 2018-03-01 10:55:41.000000000 +0100
@@ -6,6 +6,8 @@
-- Portability : unknown
--
-- X.509 Distinguished names types and functions
+
+{-# LANGUAGE CPP #-}
module Data.X509.DistinguishedName
( DistinguishedName(..)
, DistinguishedNameInner(..)
@@ -16,7 +18,11 @@
) where
import Control.Applicative
-import Data.Monoid
+#if MIN_VERSION_base(4,9,0)
+import Data.Semigroup
+#else
+import Data.Monoid
+#endif
import Data.ASN1.Types
import Data.X509.Internal
@@ -49,9 +55,16 @@
newtype DistinguishedNameInner = DistinguishedNameInner DistinguishedName
deriving (Show,Eq)
+#if MIN_VERSION_base(4,9,0)
+instance Semigroup DistinguishedName where
+ DistinguishedName l1 <> DistinguishedName l2 = DistinguishedName (l1++l2)
+#endif
+
instance Monoid DistinguishedName where
mempty = DistinguishedName []
+#if !(MIN_VERSION_base(4,11,0))
mappend (DistinguishedName l1) (DistinguishedName l2) = DistinguishedName (l1++l2)
+#endif
instance ASN1Object DistinguishedName where
toASN1 dn = \xs -> encodeDN dn ++ xs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-1.7.1/Data/X509/EC.hs new/x509-1.7.3/Data/X509/EC.hs
--- old/x509-1.7.1/Data/X509/EC.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/x509-1.7.3/Data/X509/EC.hs 2017-07-31 22:17:24.000000000 +0200
@@ -0,0 +1,126 @@
+-- |
+-- Module : Data.X509.EC
+-- License : BSD-style
+-- Maintainer : Vincent Hanquez <vincent(a)snarc.org>
+-- Stability : experimental
+-- Portability : unknown
+--
+-- Utilities related to Elliptic Curve certificates and keys.
+--
+module Data.X509.EC
+ (
+ unserializePoint
+ , ecPubKeyCurve
+ , ecPubKeyCurveName
+ , ecPrivKeyCurve
+ , ecPrivKeyCurveName
+ , lookupCurveNameByOID
+ ) where
+
+import Data.ASN1.OID
+import Data.List (find)
+
+import Data.X509.OID
+import Data.X509.PublicKey
+import Data.X509.PrivateKey
+
+import qualified Crypto.PubKey.ECC.Prim as ECC
+import qualified Crypto.PubKey.ECC.Types as ECC
+import Crypto.Number.Serialize (os2ip)
+
+import qualified Data.ByteString as B
+
+-- | Read an EC point from a serialized format and make sure the point is
+-- valid for the specified curve.
+unserializePoint :: ECC.Curve -> SerializedPoint -> Maybe ECC.Point
+unserializePoint curve (SerializedPoint bs) =
+ case B.uncons bs of
+ Nothing -> Nothing
+ Just (ptFormat, input) ->
+ case ptFormat of
+ 4 -> if B.length input /= 2 * bytes
+ then Nothing
+ else
+ let (x, y) = B.splitAt bytes input
+ p = ECC.Point (os2ip x) (os2ip y)
+ in if ECC.isPointValid curve p
+ then Just p
+ else Nothing
+ -- 2 and 3 for compressed format.
+ _ -> Nothing
+ where bits = ECC.curveSizeBits curve
+ bytes = (bits + 7) `div` 8
+
+-- | Return the curve associated to an EC Public Key. This does not check
+-- if a curve in explicit format is valid: if the input is not trusted one
+-- should consider 'ecPubKeyCurveName' instead.
+ecPubKeyCurve :: PubKeyEC -> Maybe ECC.Curve
+ecPubKeyCurve (PubKeyEC_Named name _) = Just $ ECC.getCurveByName name
+ecPubKeyCurve pub@PubKeyEC_Prime{} =
+ fmap buildCurve $
+ unserializePoint (buildCurve undefined) (pubkeyEC_generator pub)
+ where
+ prime = pubkeyEC_prime pub
+ buildCurve g =
+ let cc = ECC.CurveCommon
+ { ECC.ecc_a = pubkeyEC_a pub
+ , ECC.ecc_b = pubkeyEC_b pub
+ , ECC.ecc_g = g
+ , ECC.ecc_n = pubkeyEC_order pub
+ , ECC.ecc_h = pubkeyEC_cofactor pub
+ }
+ in ECC.CurveFP (ECC.CurvePrime prime cc)
+
+-- | Return the name of a standard curve associated to an EC Public Key
+ecPubKeyCurveName :: PubKeyEC -> Maybe ECC.CurveName
+ecPubKeyCurveName (PubKeyEC_Named name _) = Just name
+ecPubKeyCurveName pub@PubKeyEC_Prime{} =
+ find matchPrimeCurve $ enumFrom $ toEnum 0
+ where
+ matchPrimeCurve c =
+ case ECC.getCurveByName c of
+ ECC.CurveFP (ECC.CurvePrime p cc) ->
+ ECC.ecc_a cc == pubkeyEC_a pub &&
+ ECC.ecc_b cc == pubkeyEC_b pub &&
+ ECC.ecc_n cc == pubkeyEC_order pub &&
+ p == pubkeyEC_prime pub
+ _ -> False
+
+-- | Return the EC curve associated to an EC Private Key. This does not check
+-- if a curve in explicit format is valid: if the input is not trusted one
+-- should consider 'ecPrivKeyCurveName' instead.
+ecPrivKeyCurve :: PrivKeyEC -> Maybe ECC.Curve
+ecPrivKeyCurve (PrivKeyEC_Named name _) = Just $ ECC.getCurveByName name
+ecPrivKeyCurve priv@PrivKeyEC_Prime{} =
+ fmap buildCurve $
+ unserializePoint (buildCurve undefined) (privkeyEC_generator priv)
+ where
+ prime = privkeyEC_prime priv
+ buildCurve g =
+ let cc = ECC.CurveCommon
+ { ECC.ecc_a = privkeyEC_a priv
+ , ECC.ecc_b = privkeyEC_b priv
+ , ECC.ecc_g = g
+ , ECC.ecc_n = privkeyEC_order priv
+ , ECC.ecc_h = privkeyEC_cofactor priv
+ }
+ in ECC.CurveFP (ECC.CurvePrime prime cc)
+
+-- | Return the name of a standard curve associated to an EC Private Key
+ecPrivKeyCurveName :: PrivKeyEC -> Maybe ECC.CurveName
+ecPrivKeyCurveName (PrivKeyEC_Named name _) = Just name
+ecPrivKeyCurveName priv@PrivKeyEC_Prime{} =
+ find matchPrimeCurve $ enumFrom $ toEnum 0
+ where
+ matchPrimeCurve c =
+ case ECC.getCurveByName c of
+ ECC.CurveFP (ECC.CurvePrime p cc) ->
+ ECC.ecc_a cc == privkeyEC_a priv &&
+ ECC.ecc_b cc == privkeyEC_b priv &&
+ ECC.ecc_n cc == privkeyEC_order priv &&
+ p == privkeyEC_prime priv
+ _ -> False
+
+-- | Return the curve name associated to an OID
+lookupCurveNameByOID :: OID -> Maybe ECC.CurveName
+lookupCurveNameByOID = lookupByOID curvesOIDTable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-1.7.1/Data/X509/PrivateKey.hs new/x509-1.7.3/Data/X509/PrivateKey.hs
--- old/x509-1.7.1/Data/X509/PrivateKey.hs 2017-06-26 18:12:09.000000000 +0200
+++ new/x509-1.7.3/Data/X509/PrivateKey.hs 2017-07-31 22:17:24.000000000 +0200
@@ -5,25 +5,50 @@
-- Stability : experimental
-- Portability : unknown
--
--- Public key handling in X.509 infrastructure
+-- Private key handling in X.509 infrastructure
--
module Data.X509.PrivateKey
( PrivKey(..)
+ , PrivKeyEC(..)
, privkeyToAlg
) where
import Data.X509.AlgorithmIdentifier
+import Data.X509.PublicKey (SerializedPoint(..))
import qualified Crypto.PubKey.RSA as RSA
import qualified Crypto.PubKey.DSA as DSA
+import qualified Crypto.PubKey.ECC.Types as ECC
+
+-- | Elliptic Curve Private Key
+--
+-- TODO: missing support for binary curve.
+data PrivKeyEC =
+ PrivKeyEC_Prime
+ { privkeyEC_priv :: Integer
+ , privkeyEC_a :: Integer
+ , privkeyEC_b :: Integer
+ , privkeyEC_prime :: Integer
+ , privkeyEC_generator :: SerializedPoint
+ , privkeyEC_order :: Integer
+ , privkeyEC_cofactor :: Integer
+ , privkeyEC_seed :: Integer
+ }
+ | PrivKeyEC_Named
+ { privkeyEC_name :: ECC.CurveName
+ , privkeyEC_priv :: Integer
+ }
+ deriving (Show,Eq)
-- | Private key types known and used in X.509
data PrivKey =
PrivKeyRSA RSA.PrivateKey -- ^ RSA private key
| PrivKeyDSA DSA.PrivateKey -- ^ DSA private key
+ | PrivKeyEC PrivKeyEC -- ^ EC private key
deriving (Show,Eq)
--- | Convert a Public key to the Public Key Algorithm type
+-- | Convert a Private key to the Public Key Algorithm type
privkeyToAlg :: PrivKey -> PubKeyALG
privkeyToAlg (PrivKeyRSA _) = PubKeyALG_RSA
privkeyToAlg (PrivKeyDSA _) = PubKeyALG_DSA
+privkeyToAlg (PrivKeyEC _) = PubKeyALG_EC
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-1.7.1/Data/X509.hs new/x509-1.7.3/Data/X509.hs
--- old/x509-1.7.1/Data/X509.hs 2017-06-26 18:12:09.000000000 +0200
+++ new/x509-1.7.3/Data/X509.hs 2017-07-31 22:17:24.000000000 +0200
@@ -19,6 +19,7 @@
, PubKeyEC(..)
, SerializedPoint(..)
, PrivKey(..)
+ , PrivKeyEC(..)
, pubkeyToAlg
, privkeyToAlg
, module Data.X509.AlgorithmIdentifier
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/x509-1.7.1/x509.cabal new/x509-1.7.3/x509.cabal
--- old/x509-1.7.1/x509.cabal 2017-07-22 08:36:57.000000000 +0200
+++ new/x509-1.7.3/x509.cabal 2018-03-01 14:21:06.000000000 +0100
@@ -1,5 +1,5 @@
Name: x509
-version: 1.7.1
+version: 1.7.3
Description: X509 reader and writer
License: BSD3
License-file: LICENSE
@@ -21,12 +21,13 @@
, mtl
, containers
, hourglass
- , pem >= 0.1 && < 0.3
+ , pem >= 0.1
, asn1-types >= 0.3.1 && < 0.4
, asn1-encoding >= 0.9 && < 0.10
, asn1-parse >= 0.9.3 && < 0.10
- , cryptonite
+ , cryptonite >= 0.8
Exposed-modules: Data.X509
+ Data.X509.EC
Other-modules: Data.X509.Internal
Data.X509.CertificateChain
Data.X509.AlgorithmIdentifier
++++++ x509.cabal ++++++
Name: x509
version: 1.7.3
x-revision: 1
Description: X509 reader and writer
License: BSD3
License-file: LICENSE
Copyright: Vincent Hanquez <vincent(a)snarc.org>
Author: Vincent Hanquez <vincent(a)snarc.org>
Maintainer: Vincent Hanquez <vincent(a)snarc.org>
Synopsis: X509 reader and writer
Build-Type: Simple
Category: Data
stability: experimental
Homepage: http://github.com/vincenthz/hs-certificate
Cabal-Version: >= 1.10
Library
-- Could not find module 'Data.Proxy'
build-depends: base >=4.7
Default-Language: Haskell2010
Build-Depends: base >= 3 && < 5
, bytestring
, memory
, mtl
, containers
, hourglass
, pem >= 0.1
, asn1-types >= 0.3.1 && < 0.4
, asn1-encoding >= 0.9 && < 0.10
, asn1-parse >= 0.9.3 && < 0.10
, cryptonite >= 0.8
Exposed-modules: Data.X509
Data.X509.EC
Other-modules: Data.X509.Internal
Data.X509.CertificateChain
Data.X509.AlgorithmIdentifier
Data.X509.DistinguishedName
Data.X509.Cert
Data.X509.PublicKey
Data.X509.PrivateKey
Data.X509.Ext
Data.X509.ExtensionRaw
Data.X509.CRL
Data.X509.OID
Data.X509.Signed
ghc-options: -Wall
Test-Suite test-x509
Default-Language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: Tests
Main-is: Tests.hs
Build-Depends: base >= 3 && < 5
, bytestring
, mtl
, tasty
, tasty-quickcheck
, hourglass
, asn1-types
, x509
, cryptonite
ghc-options: -Wall -fno-warn-orphans -fno-warn-missing-signatures
source-repository head
type: git
location: git://github.com/vincenthz/hs-certificate
subdir: x509
1
0
Hello community,
here is the log from the commit of package ghc-void for openSUSE:Factory checked in at 2018-05-30 12:21:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-void (Old)
and /work/SRC/openSUSE:Factory/.ghc-void.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-void"
Wed May 30 12:21:35 2018 rev:8 rq:609831 version:0.7.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-void/ghc-void.changes 2017-09-15 22:23:36.504574079 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-void.new/ghc-void.changes 2018-05-30 12:27:54.121029207 +0200
@@ -1,0 +2,5 @@
+Wed May 16 14:36:30 UTC 2018 - psimons(a)suse.com
+
+- Prefer the new %license attribute over %doc.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-void.spec ++++++
--- /var/tmp/diff_new_pack.zoPAr9/_old 2018-05-30 12:27:55.044996670 +0200
+++ /var/tmp/diff_new_pack.zoPAr9/_new 2018-05-30 12:27:55.048996529 +0200
@@ -59,7 +59,7 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
%doc CHANGELOG.markdown README.markdown
1
0
Hello community,
here is the log from the commit of package ghc-vector-algorithms for openSUSE:Factory checked in at 2018-05-30 12:21:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-vector-algorithms (Old)
and /work/SRC/openSUSE:Factory/.ghc-vector-algorithms.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-vector-algorithms"
Wed May 30 12:21:32 2018 rev:5 rq:609830 version:0.7.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-vector-algorithms/ghc-vector-algorithms.changes 2017-09-15 22:23:06.760764558 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-vector-algorithms.new/ghc-vector-algorithms.changes 2018-05-30 12:27:52.489086645 +0200
@@ -1,0 +2,5 @@
+Wed May 16 14:36:30 UTC 2018 - psimons(a)suse.com
+
+- Prefer the new %license attribute over %doc.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-vector-algorithms.spec ++++++
--- /var/tmp/diff_new_pack.z246lO/_old 2018-05-30 12:27:53.689044414 +0200
+++ /var/tmp/diff_new_pack.z246lO/_new 2018-05-30 12:27:53.693044274 +0200
@@ -72,7 +72,7 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
1
0
Hello community,
here is the log from the commit of package ghc-vector for openSUSE:Factory checked in at 2018-05-30 12:21:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-vector (Old)
and /work/SRC/openSUSE:Factory/.ghc-vector.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-vector"
Wed May 30 12:21:24 2018 rev:15 rq:609829 version:0.12.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-vector/ghc-vector.changes 2017-09-15 22:23:03.437232799 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-vector.new/ghc-vector.changes 2018-05-30 12:27:51.145133922 +0200
@@ -1,0 +2,7 @@
+Wed May 16 14:36:30 UTC 2018 - psimons(a)suse.com
+
+- Prefer the new %license attribute over %doc.
+- Update Cabal file to revision 2.
+ * add support for GHC 8.4.x
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-vector.spec ++++++
--- /var/tmp/diff_new_pack.OVqIqp/_old 2018-05-30 12:27:52.321092557 +0200
+++ /var/tmp/diff_new_pack.OVqIqp/_new 2018-05-30 12:27:52.325092415 +0200
@@ -26,7 +26,7 @@
Group: Development/Libraries/Haskell
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
-Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal…
+Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/2.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-deepseq-devel
BuildRequires: ghc-primitive-devel
@@ -96,7 +96,7 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
%doc README.md changelog
++++++ vector.cabal ++++++
--- /var/tmp/diff_new_pack.OVqIqp/_old 2018-05-30 12:27:52.377090586 +0200
+++ /var/tmp/diff_new_pack.OVqIqp/_new 2018-05-30 12:27:52.377090586 +0200
@@ -1,6 +1,6 @@
Name: vector
Version: 0.12.0.1
-x-revision: 1
+x-revision: 2
-- don't forget to update the changelog file!
License: BSD3
License-File: LICENSE
@@ -145,7 +145,7 @@
Install-Includes:
vector.h
- Build-Depends: base >= 4.5 && < 4.11
+ Build-Depends: base >= 4.5 && < 4.12
, primitive >= 0.5.0.1 && < 0.7
, ghc-prim >= 0.2 && < 0.6
, deepseq >= 1.1 && < 1.5
1
0
Hello community,
here is the log from the commit of package ghc-utf8-string for openSUSE:Factory checked in at 2018-05-30 12:21:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-utf8-string (Old)
and /work/SRC/openSUSE:Factory/.ghc-utf8-string.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-utf8-string"
Wed May 30 12:21:11 2018 rev:7 rq:609827 version:1.0.1.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-utf8-string/ghc-utf8-string.changes 2017-09-15 22:22:33.393465586 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-utf8-string.new/ghc-utf8-string.changes 2018-05-30 12:27:49.333197619 +0200
@@ -1,0 +2,7 @@
+Wed May 16 14:36:29 UTC 2018 - psimons(a)suse.com
+
+- Prefer the new %license attribute over %doc.
+- Update Cabal file to revision 3.
+ * add support for GHC 8.4.x
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-utf8-string.spec ++++++
--- /var/tmp/diff_new_pack.34WnVn/_old 2018-05-30 12:27:50.001174144 +0200
+++ /var/tmp/diff_new_pack.34WnVn/_new 2018-05-30 12:27:50.005174004 +0200
@@ -25,7 +25,7 @@
Group: Development/Libraries/Haskell
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
-Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/2.cabal…
+Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/3.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-rpm-macros
@@ -63,7 +63,7 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
%doc CHANGELOG.markdown
++++++ utf8-string.cabal ++++++
--- /var/tmp/diff_new_pack.34WnVn/_old 2018-05-30 12:27:50.053172316 +0200
+++ /var/tmp/diff_new_pack.34WnVn/_new 2018-05-30 12:27:50.057172175 +0200
@@ -1,6 +1,6 @@
Name: utf8-string
Version: 1.0.1.1
-x-revision: 2
+x-revision: 3
Author: Eric Mertens
Maintainer: emertens(a)galois.com
License: BSD3
@@ -20,7 +20,7 @@
library
Ghc-options: -W -O2
- build-depends: base >= 4.3 && < 4.11, bytestring >= 0.9
+ build-depends: base >= 4.3 && < 5, bytestring >= 0.9
Extensions: CPP
Exposed-modules: Codec.Binary.UTF8.String
1
0
Hello community,
here is the log from the commit of package ghc-uuid-types for openSUSE:Factory checked in at 2018-05-30 12:21:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-uuid-types (Old)
and /work/SRC/openSUSE:Factory/.ghc-uuid-types.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-uuid-types"
Wed May 30 12:21:19 2018 rev:6 rq:609828 version:1.0.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-uuid-types/ghc-uuid-types.changes 2017-09-15 22:22:48.603322704 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-uuid-types.new/ghc-uuid-types.changes 2018-05-30 12:27:50.173168097 +0200
@@ -1,0 +2,5 @@
+Wed May 16 14:36:29 UTC 2018 - psimons(a)suse.com
+
+- Prefer the new %license attribute over %doc.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-uuid-types.spec ++++++
--- /var/tmp/diff_new_pack.XOhTk2/_old 2018-05-30 12:27:50.897142643 +0200
+++ /var/tmp/diff_new_pack.XOhTk2/_new 2018-05-30 12:27:50.901142503 +0200
@@ -79,7 +79,7 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
%doc CHANGES
1
0
Hello community,
here is the log from the commit of package ghc-uri-bytestring for openSUSE:Factory checked in at 2018-05-30 12:15:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-uri-bytestring (Old)
and /work/SRC/openSUSE:Factory/.ghc-uri-bytestring.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-uri-bytestring"
Wed May 30 12:15:49 2018 rev:6 rq:607919 version:0.3.1.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-uri-bytestring/ghc-uri-bytestring.changes 2017-09-15 22:22:12.256443551 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-uri-bytestring.new/ghc-uri-bytestring.changes 2018-05-30 12:27:48.117240342 +0200
@@ -1,0 +2,9 @@
+Mon May 14 17:02:11 UTC 2018 - psimons(a)suse.com
+
+- Update uri-bytestring to version 0.3.1.1.
+ * Avoid using OverloadedStrings for Builder.
+ * Fix normalization bug where certain combination of options would fail to add a trailing slash.
+ * Add MonadFail instance.
+ * Correct haddock spelling mistake.
+
+-------------------------------------------------------------------
Old:
----
uri-bytestring-0.2.3.3.tar.gz
New:
----
uri-bytestring-0.3.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-uri-bytestring.spec ++++++
--- /var/tmp/diff_new_pack.IddXQ2/_old 2018-05-30 12:27:49.149204087 +0200
+++ /var/tmp/diff_new_pack.IddXQ2/_new 2018-05-30 12:27:49.149204087 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-uri-bytestring
#
-# 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 uri-bytestring
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.2.3.3
+Version: 0.3.1.1
Release: 0
Summary: Haskell URI parsing as ByteStrings
License: BSD-3-Clause
@@ -31,6 +31,7 @@
BuildRequires: ghc-blaze-builder-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
+BuildRequires: ghc-fail-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-template-haskell-devel
BuildRequires: ghc-th-lift-instances-devel
@@ -81,10 +82,10 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
-%doc licenses/http-types/LICENSE
+%license LICENSE
+%license licenses/http-types/LICENSE
%files devel -f %{name}-devel.files
-%doc README.md changelog.md licenses
+%doc README.md changelog.md
%changelog
++++++ uri-bytestring-0.2.3.3.tar.gz -> uri-bytestring-0.3.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.3.3/README.md new/uri-bytestring-0.3.1.1/README.md
--- old/uri-bytestring-0.2.3.3/README.md 2017-06-06 17:27:21.000000000 +0200
+++ new/uri-bytestring-0.3.1.1/README.md 2017-09-30 00:25:09.000000000 +0200
@@ -16,3 +16,4 @@
* [Michael Hatfield](https://github.com/mikehat)
* [reactormonk](https://github.com/reactormonk)
* [Oleg Grenrus](https://github.com/phadej)
+* [Edward Betts](https://github.com/EdwardBetts)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.3.3/changelog.md new/uri-bytestring-0.3.1.1/changelog.md
--- old/uri-bytestring-0.2.3.3/changelog.md 2017-06-06 17:27:21.000000000 +0200
+++ new/uri-bytestring-0.3.1.1/changelog.md 2017-12-21 01:45:25.000000000 +0100
@@ -1,3 +1,13 @@
+0.3.0.2
+* Avoid using OverloadedStrings for Builder.
+
+0.3.0.1
+* Fix normalization bug where certain combination of options would fail to add a trailing slash.
+
+0.3.0.0
+* Add MonadFail instance.
+* Correct haddock spelling mistake.
+
0.2.3.3
* Make buildable on GHC 8.2.1.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.3.3/src/URI/ByteString/Internal.hs new/uri-bytestring-0.3.1.1/src/URI/ByteString/Internal.hs
--- old/uri-bytestring-0.2.3.3/src/URI/ByteString/Internal.hs 2017-06-06 17:27:21.000000000 +0200
+++ new/uri-bytestring-0.3.1.1/src/URI/ByteString/Internal.hs 2018-02-10 00:09:08.000000000 +0100
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
@@ -11,9 +12,10 @@
import qualified Blaze.ByteString.Builder.Char.Utf8 as BB
import Control.Applicative
import Control.Monad
+import qualified Control.Monad.Fail as F
import Data.Attoparsec.ByteString
import qualified Data.Attoparsec.ByteString as A
-import qualified Data.Attoparsec.ByteString.Char8 as A ( decimal )
+import qualified Data.Attoparsec.ByteString.Char8 as A (decimal)
import Data.Bits
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
@@ -25,6 +27,7 @@
import qualified Data.Map.Strict as M
import Data.Maybe
import Data.Monoid
+import Data.Semigroup (Semigroup)
import Data.Ord (comparing)
import Data.Word
import Text.Read (readMaybe)
@@ -142,7 +145,7 @@
-- possible, 'serializeURIRef' will be fine. If you intend on
-- comparing URIs (say for caching purposes), you'll want to use this.
normalizeURIRef :: URINormalizationOptions -> URIRef a -> Builder
-normalizeURIRef o uri@(URI {..}) = normalizeURI o uri
+normalizeURIRef o uri@(URI {..}) = normalizeURI o uri
normalizeURIRef o uri@(RelativeRef {}) = normalizeRelativeRef o Nothing uri
@@ -169,7 +172,8 @@
authority <> path <> query <> fragment
where
path
- | unoSlashEmptyPath && BS.null rrPath = "/"
+ | unoSlashEmptyPath && BS.null rrPath = BB.fromByteString "/"
+ | segs == [""] = BB.fromByteString "/"
| otherwise = mconcat (intersperse (c8 '/') (map urlEncodePath segs))
segs = dropSegs (BS.split slash (pathRewrite rrPath))
pathRewrite
@@ -366,7 +370,7 @@
query <- queryParser opts
frag <- mFragmentParser
case frag of
- Just _ -> endOfInput `orFailWith` MalformedFragment
+ Just _ -> endOfInput `orFailWith` MalformedFragment
Nothing -> endOfInput `orFailWith` MalformedQuery
return $ RelativeRef authority path query frag
@@ -791,9 +795,18 @@
, Alternative
, Monad
, MonadPlus
+ , Semigroup
, Monoid)
+instance F.MonadFail (Parser' e) where
+#if MIN_VERSION_attoparsec(0,13,1)
+ fail e = Parser' (F.fail e)
+#else
+ fail e = Parser' (fail e)
+#endif
+
+
-------------------------------------------------------------------------------
-- | Use with caution. Catch a parser failing and return Nothing.
mParse :: Parser' e a -> Parser' e (Maybe a)
@@ -804,7 +817,7 @@
-- | If the first parser succeeds, discard the result and use the
-- second parser (which may fail). If the first parser fails, return
-- Nothing. This is used to check a benign precondition that indicates
--- the presence of a parsible token, i.e. ? preceeding a query.
+-- the presence of a parsible token, i.e. ? preceding a query.
thenJust :: Parser' e a -> Parser' e b -> Parser' e (Maybe b)
thenJust p1 p2 = p1 *> (Just <$> p2) <|> pure Nothing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.3.3/src/URI/ByteString/Types.hs new/uri-bytestring-0.3.1.1/src/URI/ByteString/Types.hs
--- old/uri-bytestring-0.2.3.3/src/URI/ByteString/Types.hs 2017-06-06 17:27:21.000000000 +0200
+++ new/uri-bytestring-0.3.1.1/src/URI/ByteString/Types.hs 2018-02-10 00:25:18.000000000 +0100
@@ -15,6 +15,7 @@
import Data.ByteString (ByteString)
import qualified Data.Map.Strict as M
import Data.Monoid
+import Data.Semigroup (Semigroup)
import Data.Typeable
import Data.Word
import GHC.Generics
@@ -89,7 +90,7 @@
-------------------------------------------------------------------------------
newtype Query = Query { queryPairs :: [(ByteString, ByteString)] }
- deriving (Show, Eq, Monoid, Generic, Typeable, Ord)
+ deriving (Show, Eq, Semigroup, Monoid, Generic, Typeable, Ord)
#ifdef LIFT_COMPAT
deriveLift ''Query
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.3.3/test/URI/ByteString/Arbitrary.hs new/uri-bytestring-0.3.1.1/test/URI/ByteString/Arbitrary.hs
--- old/uri-bytestring-0.2.3.3/test/URI/ByteString/Arbitrary.hs 2017-06-06 17:27:21.000000000 +0200
+++ new/uri-bytestring-0.3.1.1/test/URI/ByteString/Arbitrary.hs 2017-09-30 00:25:09.000000000 +0200
@@ -1,3 +1,5 @@
+{-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
@@ -9,6 +11,7 @@
import Control.Applicative
import Data.Proxy (Proxy (..))
import qualified Generics.SOP as SOP
+import qualified Generics.SOP.Constraint as SOP
import qualified Generics.SOP.GGP as SOP
import GHC.Generics (Generic)
import Test.QuickCheck
@@ -22,11 +25,20 @@
-- this workaround can go away when
-- <https://github.com/nick8325/quickcheck/pull/40> is merged.
-sopArbitrary :: (Generic a, SOP.GTo a, SOP.All SOP.SListI (SOP.GCode a), SOP.All2 Arbitrary (SOP.GCode a)) => Gen a
+sopArbitrary
+ :: ( SOP.SListI (SOP.GCode b)
+ , Generic b
+ , SOP.GTo b
+ , SOP.AllF SOP.SListI (SOP.GCode b)
+ , SOP.AllF (SOP.All Arbitrary) (SOP.GCode b)
+ )
+ => Gen b
sopArbitrary = fmap SOP.gto sopArbitrary'
-sopArbitrary' :: (SOP.All SOP.SListI xss, SOP.All2 Arbitrary xss) => Gen (SOP.SOP SOP.I xss)
+sopArbitrary'
+ :: (SOP.SListI xs, SOP.AllF (SOP.All Arbitrary) xs, SOP.AllF SOP.SListI xs)
+ => Gen (SOP.SOP SOP.I xs)
sopArbitrary' = oneof (map SOP.hsequence $ SOP.apInjs_POP $ SOP.hcpure p arbitrary)
where
p :: Proxy Arbitrary
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.3.3/test/URI/ByteStringTests.hs new/uri-bytestring-0.3.1.1/test/URI/ByteStringTests.hs
--- old/uri-bytestring-0.2.3.3/test/URI/ByteStringTests.hs 2017-06-06 17:27:21.000000000 +0200
+++ new/uri-bytestring-0.3.1.1/test/URI/ByteStringTests.hs 2017-10-07 00:52:39.000000000 +0200
@@ -430,6 +430,9 @@
, testCase "percent encoding is upcased automatically" $ do
normalizeURIBS o "http://example.org/a?foo%3abar=baz" @?=
"http://example.org/a?foo%3Abar=baz"
+ , testCase "aggressive normalization retains slashes (issue 41)" $ do
+ normalizeURIBS aggressiveNormalization "http://example.org/" @?=
+ "http://example.org/"
]
where
o = noNormalization
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/uri-bytestring-0.2.3.3/uri-bytestring.cabal new/uri-bytestring-0.3.1.1/uri-bytestring.cabal
--- old/uri-bytestring-0.2.3.3/uri-bytestring.cabal 2017-06-06 17:27:21.000000000 +0200
+++ new/uri-bytestring-0.3.1.1/uri-bytestring.cabal 2018-02-26 21:15:57.000000000 +0100
@@ -1,5 +1,5 @@
name: uri-bytestring
-version: 0.2.3.3
+version: 0.3.1.1
synopsis: Haskell URI parsing as ByteStrings
description: uri-bytestring aims to be an RFC3986 compliant URI parser that uses efficient ByteStrings for parsing and representing the URI data.
license: BSD3
@@ -13,11 +13,11 @@
cabal-version: >=1.16
homepage: https://github.com/Soostone/uri-bytestring
bug-reports: https://github.com/Soostone/uri-bytestring/issues
-Tested-With: GHC == 7.6.3
- , GHC == 7.8.4
+Tested-With: GHC == 7.8.4
, GHC == 7.10.1
, GHC == 8.0.2
, GHC == 8.2.1
+ , GHC == 8.4.1
extra-source-files:
README.md
CONTRIBUTING.md
@@ -39,11 +39,12 @@
build-depends:
- attoparsec >= 0.12 && < 0.14
+ attoparsec >= 0.13.1.0 && < 0.14
, base >= 4.6 && < 5
+ , fail >= 4.9 && < 5
, bytestring >= 0.9.1 && < 0.11
, blaze-builder >= 0.3.0.0 && < 0.5
- , template-haskell >= 2.9 && < 2.13
+ , template-haskell >= 2.9 && < 2.14
, th-lift-instances >= 0.1.8 && < 0.2
, containers
@@ -53,10 +54,11 @@
if impl(ghc >= 7.8)
cpp-options: -DWITH_TYPEABLE
- if impl(ghc < 8)
+ if !impl(ghc >= 8)
cpp-options: -DLIFT_COMPAT
build-depends:
- th-lift >= 0.7.5 && < 0.8
+ th-lift >= 0.7.5 && < 0.8,
+ semigroups >= 0.16.2.2 && <0.19
if flag(lib-Werror)
ghc-options: -Werror
1
0
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(a)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 <inttypes.h>
-
-/* Cribbed from http://wiki.cs.pdx.edu/forge/popcount.html */
-static char popcount_table_8[256] = {
- /*0*/ 0,
- /*1*/ 1,
- /*2*/ 1,
- /*3*/ 2,
- /*4*/ 1,
- /*5*/ 2,
- /*6*/ 2,
- /*7*/ 3,
- /*8*/ 1,
- /*9*/ 2,
- /*10*/ 2,
- /*11*/ 3,
- /*12*/ 2,
- /*13*/ 3,
- /*14*/ 3,
- /*15*/ 4,
- /*16*/ 1,
- /*17*/ 2,
- /*18*/ 2,
- /*19*/ 3,
- /*20*/ 2,
- /*21*/ 3,
- /*22*/ 3,
- /*23*/ 4,
- /*24*/ 2,
- /*25*/ 3,
- /*26*/ 3,
- /*27*/ 4,
- /*28*/ 3,
- /*29*/ 4,
- /*30*/ 4,
- /*31*/ 5,
- /*32*/ 1,
- /*33*/ 2,
- /*34*/ 2,
- /*35*/ 3,
- /*36*/ 2,
- /*37*/ 3,
- /*38*/ 3,
- /*39*/ 4,
- /*40*/ 2,
- /*41*/ 3,
- /*42*/ 3,
- /*43*/ 4,
- /*44*/ 3,
- /*45*/ 4,
- /*46*/ 4,
- /*47*/ 5,
- /*48*/ 2,
- /*49*/ 3,
- /*50*/ 3,
- /*51*/ 4,
- /*52*/ 3,
- /*53*/ 4,
- /*54*/ 4,
- /*55*/ 5,
- /*56*/ 3,
- /*57*/ 4,
- /*58*/ 4,
- /*59*/ 5,
- /*60*/ 4,
- /*61*/ 5,
- /*62*/ 5,
- /*63*/ 6,
- /*64*/ 1,
- /*65*/ 2,
- /*66*/ 2,
- /*67*/ 3,
- /*68*/ 2,
- /*69*/ 3,
- /*70*/ 3,
- /*71*/ 4,
- /*72*/ 2,
- /*73*/ 3,
- /*74*/ 3,
- /*75*/ 4,
- /*76*/ 3,
- /*77*/ 4,
- /*78*/ 4,
- /*79*/ 5,
- /*80*/ 2,
- /*81*/ 3,
- /*82*/ 3,
- /*83*/ 4,
- /*84*/ 3,
- /*85*/ 4,
- /*86*/ 4,
- /*87*/ 5,
- /*88*/ 3,
- /*89*/ 4,
- /*90*/ 4,
- /*91*/ 5,
- /*92*/ 4,
- /*93*/ 5,
- /*94*/ 5,
- /*95*/ 6,
- /*96*/ 2,
- /*97*/ 3,
- /*98*/ 3,
- /*99*/ 4,
- /*100*/ 3,
- /*101*/ 4,
- /*102*/ 4,
- /*103*/ 5,
- /*104*/ 3,
- /*105*/ 4,
- /*106*/ 4,
- /*107*/ 5,
- /*108*/ 4,
- /*109*/ 5,
- /*110*/ 5,
- /*111*/ 6,
- /*112*/ 3,
- /*113*/ 4,
- /*114*/ 4,
- /*115*/ 5,
- /*116*/ 4,
- /*117*/ 5,
- /*118*/ 5,
- /*119*/ 6,
- /*120*/ 4,
- /*121*/ 5,
- /*122*/ 5,
- /*123*/ 6,
- /*124*/ 5,
- /*125*/ 6,
- /*126*/ 6,
- /*127*/ 7,
- /*128*/ 1,
- /*129*/ 2,
- /*130*/ 2,
- /*131*/ 3,
- /*132*/ 2,
- /*133*/ 3,
- /*134*/ 3,
- /*135*/ 4,
- /*136*/ 2,
- /*137*/ 3,
- /*138*/ 3,
- /*139*/ 4,
- /*140*/ 3,
- /*141*/ 4,
- /*142*/ 4,
- /*143*/ 5,
- /*144*/ 2,
- /*145*/ 3,
- /*146*/ 3,
- /*147*/ 4,
- /*148*/ 3,
- /*149*/ 4,
- /*150*/ 4,
- /*151*/ 5,
- /*152*/ 3,
- /*153*/ 4,
- /*154*/ 4,
- /*155*/ 5,
- /*156*/ 4,
- /*157*/ 5,
- /*158*/ 5,
- /*159*/ 6,
- /*160*/ 2,
- /*161*/ 3,
- /*162*/ 3,
- /*163*/ 4,
- /*164*/ 3,
- /*165*/ 4,
- /*166*/ 4,
- /*167*/ 5,
- /*168*/ 3,
- /*169*/ 4,
- /*170*/ 4,
- /*171*/ 5,
- /*172*/ 4,
- /*173*/ 5,
- /*174*/ 5,
- /*175*/ 6,
- /*176*/ 3,
- /*177*/ 4,
- /*178*/ 4,
- /*179*/ 5,
- /*180*/ 4,
- /*181*/ 5,
- /*182*/ 5,
- /*183*/ 6,
- /*184*/ 4,
- /*185*/ 5,
- /*186*/ 5,
- /*187*/ 6,
- /*188*/ 5,
- /*189*/ 6,
- /*190*/ 6,
- /*191*/ 7,
- /*192*/ 2,
- /*193*/ 3,
- /*194*/ 3,
- /*195*/ 4,
- /*196*/ 3,
- /*197*/ 4,
- /*198*/ 4,
- /*199*/ 5,
- /*200*/ 3,
- /*201*/ 4,
- /*202*/ 4,
- /*203*/ 5,
- /*204*/ 4,
- /*205*/ 5,
- /*206*/ 5,
- /*207*/ 6,
- /*208*/ 3,
- /*209*/ 4,
- /*210*/ 4,
- /*211*/ 5,
- /*212*/ 4,
- /*213*/ 5,
- /*214*/ 5,
- /*215*/ 6,
- /*216*/ 4,
- /*217*/ 5,
- /*218*/ 5,
- /*219*/ 6,
- /*220*/ 5,
- /*221*/ 6,
- /*222*/ 6,
- /*223*/ 7,
- /*224*/ 3,
- /*225*/ 4,
- /*226*/ 4,
- /*227*/ 5,
- /*228*/ 4,
- /*229*/ 5,
- /*230*/ 5,
- /*231*/ 6,
- /*232*/ 4,
- /*233*/ 5,
- /*234*/ 5,
- /*235*/ 6,
- /*236*/ 5,
- /*237*/ 6,
- /*238*/ 6,
- /*239*/ 7,
- /*240*/ 4,
- /*241*/ 5,
- /*242*/ 5,
- /*243*/ 6,
- /*244*/ 5,
- /*245*/ 6,
- /*246*/ 6,
- /*247*/ 7,
- /*248*/ 5,
- /*249*/ 6,
- /*250*/ 6,
- /*251*/ 7,
- /*252*/ 6,
- /*253*/ 7,
- /*254*/ 7,
- /*255*/ 8,
-};
-/* Table-driven popcount, with 8-bit tables */
-/* 6 ops plus 4 casts and 4 lookups, 0 long immediates, 4 stages */
-uint32_t
-popcount(uint32_t x)
-{
- return popcount_table_8[(uint8_t)x] +
- popcount_table_8[(uint8_t)(x >> 8)] +
- popcount_table_8[(uint8_t)(x >> 16)] +
- popcount_table_8[(uint8_t)(x >> 24)];
-}
-
-/* TODO: Add a 16-bit variant */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/tests/HashMapProperties.hs new/unordered-containers-0.2.9.0/tests/HashMapProperties.hs
--- old/unordered-containers-0.2.8.0/tests/HashMapProperties.hs 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/tests/HashMapProperties.hs 2018-02-05 18:10:45.000000000 +0100
@@ -40,6 +40,45 @@
pNeq :: [(Key, Int)] -> [(Key, Int)] -> Bool
pNeq xs = (M.fromList xs /=) `eq` (HM.fromList xs /=)
+-- We cannot compare to `Data.Map` as ordering is different.
+pOrd1 :: [(Key, Int)] -> Bool
+pOrd1 xs = compare x x == EQ
+ where
+ x = HM.fromList xs
+
+pOrd2 :: [(Key, Int)] -> [(Key, Int)] -> [(Key, Int)] -> Bool
+pOrd2 xs ys zs = case (compare x y, compare y z) of
+ (EQ, o) -> compare x z == o
+ (o, EQ) -> compare x z == o
+ (LT, LT) -> compare x z == LT
+ (GT, GT) -> compare x z == GT
+ (LT, GT) -> True -- ys greater than xs and zs.
+ (GT, LT) -> True
+ where
+ x = HM.fromList xs
+ y = HM.fromList ys
+ z = HM.fromList zs
+
+pOrd3 :: [(Key, Int)] -> [(Key, Int)] -> Bool
+pOrd3 xs ys = case (compare x y, compare y x) of
+ (EQ, EQ) -> True
+ (LT, GT) -> True
+ (GT, LT) -> True
+ _ -> False
+ where
+ x = HM.fromList xs
+ y = HM.fromList ys
+
+pOrdEq :: [(Key, Int)] -> [(Key, Int)] -> Bool
+pOrdEq xs ys = case (compare x y, x == y) of
+ (EQ, True) -> True
+ (LT, False) -> True
+ (GT, False) -> True
+ _ -> False
+ where
+ x = HM.fromList xs
+ y = HM.fromList ys
+
pReadShow :: [(Key, Int)] -> Bool
pReadShow xs = M.fromList xs == read (show (M.fromList xs))
@@ -254,6 +293,10 @@
testGroup "instances"
[ testProperty "==" pEq
, testProperty "/=" pNeq
+ , testProperty "compare reflexive" pOrd1
+ , testProperty "compare transitive" pOrd2
+ , testProperty "compare antisymmetric" pOrd3
+ , testProperty "Ord => Eq" pOrdEq
, testProperty "Read/Show" pReadShow
, testProperty "Functor" pFunctor
, testProperty "Foldable" pFoldable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/tests/HashSetProperties.hs new/unordered-containers-0.2.9.0/tests/HashSetProperties.hs
--- old/unordered-containers-0.2.8.0/tests/HashSetProperties.hs 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/tests/HashSetProperties.hs 2018-02-05 18:10:45.000000000 +0100
@@ -34,6 +34,45 @@
pNeq :: [Key] -> [Key] -> Bool
pNeq xs = (Set.fromList xs /=) `eq` (S.fromList xs /=)
+-- We cannot compare to `Data.Map` as ordering is different.
+pOrd1 :: [Key] -> Bool
+pOrd1 xs = compare x x == EQ
+ where
+ x = S.fromList xs
+
+pOrd2 :: [Key] -> [Key] -> [Key] -> Bool
+pOrd2 xs ys zs = case (compare x y, compare y z) of
+ (EQ, o) -> compare x z == o
+ (o, EQ) -> compare x z == o
+ (LT, LT) -> compare x z == LT
+ (GT, GT) -> compare x z == GT
+ (LT, GT) -> True -- ys greater than xs and zs.
+ (GT, LT) -> True
+ where
+ x = S.fromList xs
+ y = S.fromList ys
+ z = S.fromList zs
+
+pOrd3 :: [Key] -> [Key] -> Bool
+pOrd3 xs ys = case (compare x y, compare y x) of
+ (EQ, EQ) -> True
+ (LT, GT) -> True
+ (GT, LT) -> True
+ _ -> False
+ where
+ x = S.fromList xs
+ y = S.fromList ys
+
+pOrdEq :: [Key] -> [Key] -> Bool
+pOrdEq xs ys = case (compare x y, x == y) of
+ (EQ, True) -> True
+ (LT, False) -> True
+ (GT, False) -> True
+ _ -> False
+ where
+ x = S.fromList xs
+ y = S.fromList ys
+
pReadShow :: [Key] -> Bool
pReadShow xs = Set.fromList xs == read (show (Set.fromList xs))
@@ -136,6 +175,10 @@
[ testProperty "==" pEq
, testProperty "Permutation ==" pPermutationEq
, testProperty "/=" pNeq
+ , testProperty "compare reflexive" pOrd1
+ , testProperty "compare transitive" pOrd2
+ , testProperty "compare antisymmetric" pOrd3
+ , testProperty "Ord => Eq" pOrdEq
, testProperty "Read/Show" pReadShow
, testProperty "Foldable" pFoldable
, testProperty "Hashable" pHashable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/tests/List.hs new/unordered-containers-0.2.9.0/tests/List.hs
--- old/unordered-containers-0.2.8.0/tests/List.hs 1970-01-01 01:00:00.000000000 +0100
+++ new/unordered-containers-0.2.9.0/tests/List.hs 2018-02-05 18:10:45.000000000 +0100
@@ -0,0 +1,68 @@
+module Main (main) where
+
+import Data.HashMap.List
+import Data.List (nub, sort, sortBy)
+import Data.Ord (comparing)
+
+import Test.Framework (Test, defaultMain, testGroup)
+import Test.Framework.Providers.QuickCheck2 (testProperty)
+import Test.QuickCheck ((==>), (===), property, Property)
+
+tests :: Test
+tests = testGroup "Data.HashMap.List"
+ [ testProperty "isPermutationBy" pIsPermutation
+ , testProperty "isPermutationBy of different length" pIsPermutationDiffLength
+ , testProperty "pUnorderedCompare" pUnorderedCompare
+ , testGroup "modelUnorderedCompare"
+ [ testProperty "reflexive" modelUnorderedCompareRefl
+ , testProperty "anti-symmetric" modelUnorderedCompareAntiSymm
+ , testProperty "transitive" modelUnorderedCompareTrans
+ ]
+ ]
+
+pIsPermutation :: [Char] -> [Int] -> Bool
+pIsPermutation xs is = isPermutationBy (==) xs xs'
+ where
+ is' = nub is ++ [maximum (0:is) + 1 ..]
+ xs' = map fst . sortBy (comparing snd) $ zip xs is'
+
+pIsPermutationDiffLength :: [Int] -> [Int] -> Property
+pIsPermutationDiffLength xs ys =
+ length xs /= length ys ==> isPermutationBy (==) xs ys === False
+
+-- | Homogenous version of 'unorderedCompare'
+--
+-- *Compare smallest non-equal elements of the two lists*.
+modelUnorderedCompare :: Ord a => [a] -> [a] -> Ordering
+modelUnorderedCompare as bs = compare (sort as) (sort bs)
+
+modelUnorderedCompareRefl :: [Int] -> Property
+modelUnorderedCompareRefl xs = modelUnorderedCompare xs xs === EQ
+
+modelUnorderedCompareAntiSymm :: [Int] -> [Int] -> Property
+modelUnorderedCompareAntiSymm xs ys = case a of
+ EQ -> b === EQ
+ LT -> b === GT
+ GT -> b === LT
+ where
+ a = modelUnorderedCompare xs ys
+ b = modelUnorderedCompare ys xs
+
+modelUnorderedCompareTrans :: [Int] -> [Int] -> [Int] -> Property
+modelUnorderedCompareTrans xs ys zs =
+ case (modelUnorderedCompare xs ys, modelUnorderedCompare ys zs) of
+ (EQ, yz) -> xz === yz
+ (xy, EQ) -> xz === xy
+ (LT, LT) -> xz === LT
+ (GT, GT) -> xz === GT
+ (LT, GT) -> property True
+ (GT, LT) -> property True
+ where
+ xz = modelUnorderedCompare xs zs
+
+pUnorderedCompare :: [Int] -> [Int] -> Property
+pUnorderedCompare xs ys =
+ unorderedCompare compare xs ys === modelUnorderedCompare xs ys
+
+main :: IO ()
+main = defaultMain [tests]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/tests/Strictness.hs new/unordered-containers-0.2.9.0/tests/Strictness.hs
--- old/unordered-containers-0.2.8.0/tests/Strictness.hs 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/tests/Strictness.hs 2018-02-05 18:10:45.000000000 +0100
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE CPP, FlexibleInstances, GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Main (main) where
@@ -7,7 +7,18 @@
import Test.ChasingBottoms.IsBottom
import Test.Framework (Test, defaultMain, testGroup)
import Test.Framework.Providers.QuickCheck2 (testProperty)
-import Test.QuickCheck (Arbitrary(arbitrary))
+import Test.QuickCheck (Arbitrary(arbitrary), Property, (===), (.&&.))
+import Test.QuickCheck.Function
+import Test.QuickCheck.Poly (A)
+import Data.Maybe (fromMaybe, isJust)
+import Control.Arrow (second)
+import Control.Monad (guard)
+import Data.Foldable (foldl')
+#if !MIN_VERSION_base(4,8,0)
+import Data.Functor ((<$))
+import Data.Foldable (all)
+import Prelude hiding (all)
+#endif
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as HM
@@ -79,10 +90,63 @@
pFromListWithKeyStrict f =
isBottom $ HM.fromListWith f [(undefined :: Key, 1 :: Int)]
-pFromListWithValueStrict :: [(Key, Int)] -> Bool
-pFromListWithValueStrict xs = case xs of
- [] -> True
- (x:_) -> isBottom $ HM.fromListWith (\ _ _ -> undefined) (x:xs)
+-- The strictness properties of 'fromListWith' are not entirely
+-- trivial.
+-- fromListWith f kvs is strict in the first value seen for each
+-- key, but potentially lazy in the rest: the combining function
+-- could be lazy in the "new" value. fromListWith must, however,
+-- be strict in whatever value is actually inserted into the map.
+-- Getting all these properties specified efficiently seems tricky.
+-- Since it's not hard, we verify that the converted HashMap has
+-- no unforced values. Rather than trying to go into detail for the
+-- rest, this test compares the strictness behavior of fromListWith
+-- to that of insertWith. The latter should be easier to specify
+-- and (if we choose to do so) test thoroughly.
+--
+-- We'll fake up a representation of things that are possibly
+-- bottom by using Nothing to represent bottom. The combining
+-- (partial) function is represented by a "lazy total" function
+-- Maybe a -> Maybe a -> Maybe a, along with a function determining
+-- whether the result should be non-bottom, Maybe a -> Maybe a -> Bool,
+-- indicating how the combining function should behave if neither
+-- argument, just the first argument, just the second argument,
+-- or both arguments are bottom. It would be quite tempting to
+-- just use Maybe A -> Maybe A -> Maybe A, but that would not
+-- necessarily be continous.
+pFromListWithValueResultStrict :: [(Key, Maybe A)]
+ -> Fun (Maybe A, Maybe A) A
+ -> Fun (Maybe A, Maybe A) Bool
+ -> Property
+pFromListWithValueResultStrict lst comb_lazy calc_good_raw
+ = all (all isJust) recovered .&&. (recovered === recover (fmap recover fake_map))
+ where
+ recovered :: Maybe (HashMap Key (Maybe A))
+ recovered = recover (fmap recover real_map)
+ -- What we get out of the conversion using insertWith
+ fake_map = foldl' (\m (k,v) -> HM.insertWith real_comb k v m) HM.empty real_list
+
+ -- A continuous version of calc_good_raw
+ calc_good Nothing Nothing = cgr Nothing Nothing
+ calc_good Nothing y@(Just _) = cgr Nothing Nothing || cgr Nothing y
+ calc_good x@(Just _) Nothing = cgr Nothing Nothing || cgr x Nothing
+ calc_good x y = cgr Nothing Nothing || cgr Nothing y || cgr x Nothing || cgr x y
+ cgr = curry $ apply calc_good_raw
+
+ -- The Maybe A -> Maybe A -> Maybe A that we're after, representing a
+ -- potentially less total function than comb_lazy
+ comb x y = apply comb_lazy (x, y) <$ guard (calc_good x y)
+
+ -- What we get out of the conversion using fromListWith
+ real_map = HM.fromListWith real_comb real_list
+
+ -- A list that may have actual bottom values in it.
+ real_list = map (second (fromMaybe bottom)) lst
+
+ -- A genuinely partial function mirroring comb
+ real_comb x y = fromMaybe bottom $ comb (recover x) (recover y)
+
+ recover :: a -> Maybe a
+ recover a = a <$ guard (not $ isBottom a)
------------------------------------------------------------------------
-- * Test list
@@ -108,7 +172,7 @@
, testProperty "fromList is key-strict" pFromListKeyStrict
, testProperty "fromList is value-strict" pFromListValueStrict
, testProperty "fromListWith is key-strict" pFromListWithKeyStrict
- , testProperty "fromListWith is value-strict" pFromListWithValueStrict
+ , testProperty "fromListWith is value-strict" pFromListWithValueResultStrict
]
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unordered-containers-0.2.8.0/unordered-containers.cabal new/unordered-containers-0.2.9.0/unordered-containers.cabal
--- old/unordered-containers-0.2.8.0/unordered-containers.cabal 2017-03-18 00:38:19.000000000 +0100
+++ new/unordered-containers-0.2.9.0/unordered-containers.cabal 2018-02-05 18:10:45.000000000 +0100
@@ -1,5 +1,5 @@
name: unordered-containers
-version: 0.2.8.0
+version: 0.2.9.0
synopsis: Efficient hashing-based container types
description:
Efficient hashing-based container types. The containers have been
@@ -20,7 +20,7 @@
build-type: Simple
cabal-version: >=1.8
extra-source-files: CHANGES.md
-tested-with: GHC==8.0.1, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2
+tested-with: GHC==8.4.1, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4
flag debug
description: Enable debug support
@@ -34,21 +34,29 @@
other-modules:
Data.HashMap.Array
Data.HashMap.Base
- Data.HashMap.PopCount
+ Data.HashMap.List
Data.HashMap.Unsafe
Data.HashMap.UnsafeShift
build-depends:
- base >= 4 && < 5,
+ base >= 4.7 && < 5,
deepseq >= 1.1,
hashable >= 1.0.1.1 && < 1.3
- if impl(ghc < 7.4)
- c-sources: cbits/popc.c
-
- ghc-options: -Wall -O2
- if impl(ghc >= 6.8)
- ghc-options: -fwarn-tabs
+ other-extensions:
+ RoleAnnotations,
+ UnboxedTuples,
+ ScopedTypeVariables,
+ MagicHash,
+ BangPatterns
+
+ ghc-options: -Wall -O2 -fwarn-tabs -ferror-spans
+
+ if impl (ghc < 8.2)
+ -- This is absolutely necessary (but not sufficient) for correctness due to
+ -- the referential-transparency-breaking mutability in unsafeInsertWith. See
+ -- #147 and GHC #13615 for details. The bug was fixed in GHC 8.2.
+ ghc-options: -feager-blackholing
if flag(debug)
cpp-options: -DASSERTS
@@ -103,6 +111,23 @@
ghc-options: -Wall
cpp-options: -DASSERTS
+test-suite list-tests
+ hs-source-dirs: tests .
+ main-is: List.hs
+ other-modules:
+ Data.HashMap.List
+ type: exitcode-stdio-1.0
+
+ build-depends:
+ base,
+ containers >= 0.4,
+ QuickCheck >= 2.4.0.1,
+ test-framework >= 0.3.3,
+ test-framework-quickcheck2 >= 0.2.9
+
+ ghc-options: -Wall
+ cpp-options: -DASSERTS
+
test-suite regressions
hs-source-dirs: tests
main-is: Regressions.hs
@@ -151,7 +176,6 @@
Data.HashMap.Array
Data.HashMap.Base
Data.HashMap.Lazy
- Data.HashMap.PopCount
Data.HashMap.Strict
Data.HashMap.Unsafe
Data.HashMap.UnsafeShift
@@ -164,7 +188,7 @@
base,
bytestring,
containers,
- criterion >= 1.0 && < 1.2,
+ criterion >= 1.0 && < 1.3,
deepseq >= 1.1,
deepseq-generics,
hashable >= 1.0.1.1,
@@ -172,14 +196,7 @@
mtl,
random
- if impl(ghc < 7.4)
- c-sources: cbits/popc.c
-
- ghc-options: -Wall -O2 -rtsopts
- if impl(ghc >= 6.8)
- ghc-options: -fwarn-tabs
- if impl(ghc > 6.10)
- ghc-options: -fregs-graph
+ ghc-options: -Wall -O2 -rtsopts -fwarn-tabs -ferror-spans
if flag(debug)
cpp-options: -DASSERTS
1
0
Hello community,
here is the log from the commit of package ghc-unix-time for openSUSE:Factory checked in at 2018-05-30 12:15:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-unix-time (Old)
and /work/SRC/openSUSE:Factory/.ghc-unix-time.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-unix-time"
Wed May 30 12:15:26 2018 rev:6 rq:607915 version:0.3.8
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-unix-time/ghc-unix-time.changes 2017-09-15 22:21:54.982876839 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-unix-time.new/ghc-unix-time.changes 2018-05-30 12:27:46.453298768 +0200
@@ -1,0 +2,6 @@
+Mon May 14 17:02:11 UTC 2018 - psimons(a)suse.com
+
+- Update unix-time to version 0.3.8.
+ Upstream does not provide a changelog.
+
+-------------------------------------------------------------------
Old:
----
unix-time-0.3.7.tar.gz
New:
----
unix-time-0.3.8.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-unix-time.spec ++++++
--- /var/tmp/diff_new_pack.00vK93/_old 2018-05-30 12:27:47.025278690 +0200
+++ /var/tmp/diff_new_pack.00vK93/_new 2018-05-30 12:27:47.029278549 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-unix-time
#
-# 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 unix-time
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.3.7
+Version: 0.3.8
Release: 0
Summary: Unix time parser/formatter and utilities
License: BSD-3-Clause
@@ -72,7 +72,7 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
++++++ unix-time-0.3.7.tar.gz -> unix-time-0.3.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-time-0.3.7/Data/UnixTime/Sys.hsc new/unix-time-0.3.8/Data/UnixTime/Sys.hsc
--- old/unix-time-0.3.7/Data/UnixTime/Sys.hsc 2016-09-06 04:46:51.000000000 +0200
+++ new/unix-time-0.3.8/Data/UnixTime/Sys.hsc 2018-02-26 02:38:36.000000000 +0100
@@ -21,7 +21,7 @@
c_gettimeofday :: Ptr CTimeVal -> Ptr CTimeZone -> IO CInt
-- |
--- Getting 'UnixTime' from OS.
+-- Get current 'UnixTime' from OS.
getUnixTime :: IO UnixTime
getUnixTime = allocaBytes (#const sizeof(struct timeval)) $ \ p_timeval -> do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-time-0.3.7/unix-time.cabal new/unix-time-0.3.8/unix-time.cabal
--- old/unix-time-0.3.7/unix-time.cabal 2016-09-06 04:46:51.000000000 +0200
+++ new/unix-time-0.3.8/unix-time.cabal 2018-02-26 02:38:36.000000000 +0100
@@ -1,5 +1,5 @@
Name: unix-time
-Version: 0.3.7
+Version: 0.3.8
Author: Kazu Yamamoto <kazu(a)iij.ad.jp>
Maintainer: Kazu Yamamoto <kazu(a)iij.ad.jp>
License: BSD3
@@ -27,6 +27,7 @@
, old-time
, binary
C-Sources: cbits/conv.c
+ include-dirs: cbits
Test-Suite doctest
Type: exitcode-stdio-1.0
1
0
Hello community,
here is the log from the commit of package ghc-unix-compat for openSUSE:Factory checked in at 2018-05-30 12:15:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-unix-compat (Old)
and /work/SRC/openSUSE:Factory/.ghc-unix-compat.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-unix-compat"
Wed May 30 12:15:21 2018 rev:7 rq:607914 version:0.5.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-unix-compat/ghc-unix-compat.changes 2017-09-15 22:21:52.567217089 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-unix-compat.new/ghc-unix-compat.changes 2018-05-30 12:27:45.665326424 +0200
@@ -1,0 +2,6 @@
+Mon May 14 17:02:11 UTC 2018 - psimons(a)suse.com
+
+- Update unix-compat to version 0.5.0.1.
+ Upstream does not provide a changelog.
+
+-------------------------------------------------------------------
Old:
----
unix-compat-0.4.3.1.tar.gz
unix-compat.cabal
New:
----
unix-compat-0.5.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-unix-compat.spec ++++++
--- /var/tmp/diff_new_pack.avy3po/_old 2018-05-30 12:27:46.249305929 +0200
+++ /var/tmp/diff_new_pack.avy3po/_new 2018-05-30 12:27:46.257305648 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-unix-compat
#
-# 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
@@ -18,14 +18,13 @@
%global pkg_name unix-compat
Name: ghc-%{pkg_name}
-Version: 0.4.3.1
+Version: 0.5.0.1
Release: 0
Summary: Portable POSIX-compatibility layer
License: BSD-3-Clause
Group: Development/Libraries/Haskell
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{ve…
-Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/2.cabal…
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-unix-devel
@@ -48,7 +47,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
@@ -63,7 +61,7 @@
%ghc_pkg_recache
%files -f %{name}.files
-%doc LICENSE
+%license LICENSE
%files devel -f %{name}-devel.files
++++++ unix-compat-0.4.3.1.tar.gz -> unix-compat-0.5.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-compat-0.4.3.1/src/System/PosixCompat/Files.hsc new/unix-compat-0.5.0.1/src/System/PosixCompat/Files.hsc
--- old/unix-compat-0.4.3.1/src/System/PosixCompat/Files.hsc 2016-12-06 15:22:00.000000000 +0100
+++ new/unix-compat-0.5.0.1/src/System/PosixCompat/Files.hsc 2017-12-06 02:45:18.000000000 +0100
@@ -134,6 +134,7 @@
import System.IO.Error
import System.PosixCompat.Types
import System.Win32.File hiding (getFileType)
+import System.Win32.HardLink (createHardLink)
import System.Win32.Time (FILETIME(..), getFileTime, setFileTime)
import System.PosixCompat.Internal.Time (
@@ -373,7 +374,7 @@
-- Hard links
createLink :: FilePath -> FilePath -> IO ()
-createLink _ _ = unsupported "createLink"
+createLink = createHardLink
removeLink :: FilePath -> IO ()
removeLink _ = unsupported "removeLink"
@@ -388,10 +389,14 @@
readSymbolicLink _ = unsupported "readSymbolicLink"
-- -----------------------------------------------------------------------------
--- Renaming files
+-- Renaming
rename :: FilePath -> FilePath -> IO ()
-rename name1 name2 = renameFile name1 name2
+#if MIN_VERSION_Win32(2, 6, 0)
+rename name1 name2 = moveFileEx name1 (Just name2) mOVEFILE_REPLACE_EXISTING
+#else
+rename name1 name2 = moveFileEx name1 name2 mOVEFILE_REPLACE_EXISTING
+#endif
-- -----------------------------------------------------------------------------
-- chown()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unix-compat-0.4.3.1/unix-compat.cabal new/unix-compat-0.5.0.1/unix-compat.cabal
--- old/unix-compat-0.4.3.1/unix-compat.cabal 2016-12-06 15:22:00.000000000 +0100
+++ new/unix-compat-0.5.0.1/unix-compat.cabal 2017-12-06 02:45:18.000000000 +0100
@@ -1,5 +1,5 @@
name: unix-compat
-version: 0.4.3.1
+version: 0.5.0.1
synopsis: Portable POSIX-compatibility layer.
description: This package provides portable implementations of parts
of the unix package. This package re-exports the unix
@@ -44,7 +44,7 @@
cbits/mktemp.c
extra-libraries: msvcrt
- build-depends: Win32 >= 2.3.0.2
+ build-depends: Win32 >= 2.5.0.0
if flag(old-time)
build-depends: old-time >= 1.0.0.0 && < 1.2.0.0
@@ -56,8 +56,8 @@
else
build-depends: directory == 1.1.*
else
- build-depends: time >= 1.0 && < 1.7
- build-depends: directory >= 1.2 && < 1.3
+ build-depends: time >= 1.0 && < 1.9
+ build-depends: directory >= 1.2 && < 1.4
other-modules:
System.PosixCompat.Internal.Time
1
0