Hello community, here is the log from the commit of package ghc-QuickCheck for openSUSE:Factory checked in at 2020-11-19 11:58:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-QuickCheck (Old) and /work/SRC/openSUSE:Factory/.ghc-QuickCheck.new.5913 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-QuickCheck" Thu Nov 19 11:58:20 2020 rev:23 rq:849153 version:2.14.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-QuickCheck/ghc-QuickCheck.changes 2020-08-28 21:24:13.080406574 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-QuickCheck.new.5913/ghc-QuickCheck.changes 2020-11-23 10:27:04.593131869 +0100 @@ -1,0 +2,9 @@ +Sun Nov 15 12:26:19 UTC 2020 - [email protected] + +- Update QuickCheck to version 2.14.2. + Upstream has edited the change log file since the last release in + a non-trivial way, i.e. they did more than just add a new entry + at the top. You can review the file at: + http://hackage.haskell.org/package/QuickCheck-2.14.2/src/changelog + +------------------------------------------------------------------- Old: ---- QuickCheck-2.14.1.tar.gz New: ---- QuickCheck-2.14.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-QuickCheck.spec ++++++ --- /var/tmp/diff_new_pack.Ie2CkP/_old 2020-11-23 10:27:05.209132565 +0100 +++ /var/tmp/diff_new_pack.Ie2CkP/_new 2020-11-23 10:27:05.213132569 +0100 @@ -19,7 +19,7 @@ %global pkg_name QuickCheck %bcond_with tests Name: ghc-%{pkg_name} -Version: 2.14.1 +Version: 2.14.2 Release: 0 Summary: Automatic testing of Haskell programs License: BSD-3-Clause ++++++ QuickCheck-2.14.1.tar.gz -> QuickCheck-2.14.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QuickCheck-2.14.1/QuickCheck.cabal new/QuickCheck-2.14.2/QuickCheck.cabal --- old/QuickCheck-2.14.1/QuickCheck.cabal 2020-07-05 14:22:05.000000000 +0200 +++ new/QuickCheck-2.14.2/QuickCheck.cabal 2020-11-14 22:49:32.000000000 +0100 @@ -1,5 +1,5 @@ Name: QuickCheck -Version: 2.14.1 +Version: 2.14.2 Cabal-Version: >= 1.10 Build-type: Simple License: BSD3 @@ -57,7 +57,7 @@ source-repository this type: git location: https://github.com/nick8325/quickcheck - tag: 2.14.1 + tag: 2.14.2 flag templateHaskell Description: Build Test.QuickCheck.All, which uses Template Haskell. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QuickCheck-2.14.1/changelog new/QuickCheck-2.14.2/changelog --- old/QuickCheck-2.14.1/changelog 2020-07-05 14:22:05.000000000 +0200 +++ new/QuickCheck-2.14.2/changelog 2020-11-14 22:48:45.000000000 +0100 @@ -1,4 +1,8 @@ -QuickCheck 2.14.1 (release 2020-07-05) +QuickCheck 2.14.2 (released 2020-11-14) + * Add Arbitrary instances for Tree (thanks to Oleg Grenrus) + * GHC 9.0 compatibility (thanks to Vilem-Benjamin Liepelt) + +QuickCheck 2.14.1 (released 2020-07-05) * Compatibility with random >= 1.2. QuickCheck 2.14 (released 2020-03-28) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QuickCheck-2.14.1/examples/Heap.hs new/QuickCheck-2.14.2/examples/Heap.hs --- old/QuickCheck-2.14.1/examples/Heap.hs 2020-07-05 14:22:05.000000000 +0200 +++ new/QuickCheck-2.14.2/examples/Heap.hs 2020-10-15 16:13:04.000000000 +0200 @@ -1,8 +1,6 @@ {-# LANGUAGE ScopedTypeVariables, TemplateHaskell #-} module Main where -import Data.Int - -------------------------------------------------------------------------- -- imports @@ -146,7 +144,7 @@ -- main return [] -main = $forAllProperties (quickCheckWithResult stdArgs{maxSuccess = 10000}) +main = $quickCheckAll -------------------------------------------------------------------------- -- the end. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QuickCheck-2.14.1/src/Test/QuickCheck/All.hs new/QuickCheck-2.14.2/src/Test/QuickCheck/All.hs --- old/QuickCheck-2.14.1/src/Test/QuickCheck/All.hs 2020-07-05 14:22:05.000000000 +0200 +++ new/QuickCheck-2.14.2/src/Test/QuickCheck/All.hs 2020-11-14 22:47:20.000000000 +0100 @@ -98,16 +98,21 @@ #endif deconstructType :: Error -> Type -> Q ([Name], Cxt, Type) -deconstructType err ty0@(ForallT xs ctx ty) = do - let plain (PlainTV _) = True -#if MIN_VERSION_template_haskell(2,8,0) - plain (KindedTV _ StarT) = True +deconstructType err (ForallT xs ctx ty) = do +#if MIN_VERSION_template_haskell(2,17,0) + let plain (PlainTV nm _) = return nm + plain (KindedTV nm _ StarT) = return nm #else - plain (KindedTV _ StarK) = True + let plain (PlainTV nm) = return nm +# if MIN_VERSION_template_haskell(2,8,0) + plain (KindedTV nm StarT) = return nm +# else + plain (KindedTV nm StarK) = return nm +# endif #endif - plain _ = False - unless (all plain xs) $ err "Higher-kinded type variables in type" - return (map (\(PlainTV x) -> x) xs, ctx, ty) + plain _ = err "Higher-kinded type variables in type" + xs' <- mapM plain xs + return (xs', ctx, ty) deconstructType _ ty = return ([], [], ty) monomorphiseType :: Error -> Type -> Type -> TypeQ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QuickCheck-2.14.1/src/Test/QuickCheck/Arbitrary.hs new/QuickCheck-2.14.2/src/Test/QuickCheck/Arbitrary.hs --- old/QuickCheck-2.14.1/src/Test/QuickCheck/Arbitrary.hs 2020-07-05 14:22:05.000000000 +0200 +++ new/QuickCheck-2.14.2/src/Test/QuickCheck/Arbitrary.hs 2020-11-14 22:47:20.000000000 +0100 @@ -159,6 +159,7 @@ import qualified Data.IntSet as IntSet import qualified Data.IntMap as IntMap import qualified Data.Sequence as Sequence +import qualified Data.Tree as Tree import Data.Bits import qualified Data.Monoid as Monoid @@ -821,6 +822,35 @@ instance Arbitrary a => Arbitrary (Sequence.Seq a) where arbitrary = arbitrary1 shrink = shrink1 +instance Arbitrary1 Tree.Tree where + liftArbitrary arb = sized $ \n -> do + k <- chooseInt (0, n) + go k + where + go n = do -- n is the size of the trees. + value <- arb + pars <- arbPartition (n - 1) -- can go negative! + forest <- mapM go pars + return $ Tree.Node value forest + + arbPartition :: Int -> Gen [Int] + arbPartition k = case compare k 1 of + LT -> pure [] + EQ -> pure [1] + GT -> do + first <- chooseInt (1, k) + rest <- arbPartition $ k - first + shuffle (first : rest) + + liftShrink shr = go + where + go (Tree.Node val forest) = forest ++ + [ Tree.Node e fs + | (e, fs) <- liftShrink2 shr (liftShrink go) (val, forest) + ] +instance Arbitrary a => Arbitrary (Tree.Tree a) where + arbitrary = arbitrary1 + shrink = shrink1 -- Arbitrary instance for Ziplist instance Arbitrary1 ZipList where @@ -1360,6 +1390,8 @@ coarbitrary = coarbitrary . IntMap.toList instance CoArbitrary a => CoArbitrary (Sequence.Seq a) where coarbitrary = coarbitrary . toList +instance CoArbitrary a => CoArbitrary (Tree.Tree a) where + coarbitrary (Tree.Node val forest) = coarbitrary val . coarbitrary forest -- CoArbitrary instance for Ziplist instance CoArbitrary a => CoArbitrary (ZipList a) where diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QuickCheck-2.14.1/src/Test/QuickCheck/Function.hs new/QuickCheck-2.14.2/src/Test/QuickCheck/Function.hs --- old/QuickCheck-2.14.1/src/Test/QuickCheck/Function.hs 2020-07-05 14:22:05.000000000 +0200 +++ new/QuickCheck-2.14.2/src/Test/QuickCheck/Function.hs 2020-11-14 22:47:20.000000000 +0100 @@ -76,6 +76,7 @@ import qualified Data.Map as Map import qualified Data.Set as Set import qualified Data.Sequence as Sequence +import qualified Data.Tree as Tree import Data.Int import Data.Complex import Data.Foldable(toList) @@ -339,6 +340,9 @@ instance Function a => Function (Sequence.Seq a) where function = functionMap toList Sequence.fromList +instance Function a => Function (Tree.Tree a) where + function = functionMap (\(Tree.Node x xs) -> (x,xs)) (uncurry Tree.Node) + instance Function Int8 where function = functionBoundedEnum _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
