Hello community, here is the log from the commit of package ghc-dual-tree for openSUSE:Factory checked in at 2017-07-27 11:11:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-dual-tree (Old) and /work/SRC/openSUSE:Factory/.ghc-dual-tree.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-dual-tree" Thu Jul 27 11:11:47 2017 rev:2 rq:511511 version:0.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-dual-tree/ghc-dual-tree.changes 2016-11-03 11:12:59.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-dual-tree.new/ghc-dual-tree.changes 2017-07-27 11:11:51.820696601 +0200 @@ -1,0 +2,5 @@ +Tue Jul 11 03:02:24 UTC 2017 - [email protected] + +- Update to version 0.2.1. + +------------------------------------------------------------------- Old: ---- dual-tree-0.2.0.9.tar.gz New: ---- dual-tree-0.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-dual-tree.spec ++++++ --- /var/tmp/diff_new_pack.VNsbRg/_old 2017-07-27 11:11:52.316626547 +0200 +++ /var/tmp/diff_new_pack.VNsbRg/_new 2017-07-27 11:11:52.320625982 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-dual-tree # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 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 @@ -17,22 +17,25 @@ %global pkg_name dual-tree +%bcond_with tests Name: ghc-%{pkg_name} -Version: 0.2.0.9 +Version: 0.2.1 Release: 0 Summary: Rose trees with cached and accumulating monoidal annotations License: BSD-3-Clause -Group: System/Libraries +Group: Development/Languages/Other Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz BuildRequires: ghc-Cabal-devel -# Begin cabal-rpm deps: BuildRequires: ghc-monoid-extras-devel -BuildRequires: ghc-newtype-devel +BuildRequires: ghc-newtype-generics-devel BuildRequires: ghc-rpm-macros BuildRequires: ghc-semigroups-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build -# End cabal-rpm deps +%if %{with tests} +BuildRequires: ghc-QuickCheck-devel +BuildRequires: ghc-testing-feat-devel +%endif %description Rose (n-ary) trees with both upwards- (/i.e./ cached) and downwards-traveling @@ -64,14 +67,14 @@ %prep %setup -q -n %{pkg_name}-%{version} - %build %ghc_lib_build - %install %ghc_lib_install +%check +%cabal_test %post devel %ghc_pkg_recache @@ -85,5 +88,6 @@ %files devel -f %{name}-devel.files %defattr(-,root,root,-) +%doc CHANGES %changelog ++++++ dual-tree-0.2.0.9.tar.gz -> dual-tree-0.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dual-tree-0.2.0.9/CHANGES new/dual-tree-0.2.1/CHANGES --- old/dual-tree-0.2.0.9/CHANGES 2016-02-14 19:02:08.000000000 +0100 +++ new/dual-tree-0.2.1/CHANGES 2017-07-03 16:52:07.000000000 +0200 @@ -1,3 +1,12 @@ +* 0.2.1: 3 July 2017 + +- migrate from newtype to newtype-generics dependency + This change only affects internals of the library. +- improve tests +- allow base-4.10 +- derive Typeable instead of deprecated Typeable1 +- drop support for GHC < 7.8 + * 0.2.0.9: 14 February 2016 - allow base-4.9 for GHC-8.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dual-tree-0.2.0.9/LICENSE new/dual-tree-0.2.1/LICENSE --- old/dual-tree-0.2.0.9/LICENSE 2015-04-12 04:37:12.000000000 +0200 +++ new/dual-tree-0.2.1/LICENSE 2017-07-03 16:52:07.000000000 +0200 @@ -1,5 +1,6 @@ -Copyright (c) 2011-2013, dual-tree team: +Copyright (c) 2011-2016, dual-tree team: + Daniel Bergey <[email protected]> Christopher Chalmers <[email protected]> Jeffrey Rosenbluth <[email protected]> Ryan Yates <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dual-tree-0.2.0.9/dual-tree.cabal new/dual-tree-0.2.1/dual-tree.cabal --- old/dual-tree-0.2.0.9/dual-tree.cabal 2016-02-13 00:40:14.000000000 +0100 +++ new/dual-tree-0.2.1/dual-tree.cabal 2017-07-03 16:52:07.000000000 +0200 @@ -1,5 +1,5 @@ name: dual-tree -version: 0.2.0.9 +version: 0.2.1 synopsis: Rose trees with cached and accumulating monoidal annotations description: Rose (n-ary) trees with both upwards- (/i.e./ cached) and downwards-traveling (/i.e./ @@ -31,7 +31,7 @@ build-type: Simple cabal-version: >=1.10 bug-reports: https://github.com/diagrams/dual-tree/issues -tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.1 +tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1 source-repository head type: git location: https://github.com/diagrams/dual-tree.git @@ -40,9 +40,9 @@ default-language: Haskell2010 exposed-modules: Data.Tree.DUAL Data.Tree.DUAL.Internal - build-depends: base >= 4.3 && < 4.10, + build-depends: base >= 4.3 && < 4.11, semigroups >= 0.8 && < 0.19, - newtype >= 0.2 && < 0.3, + newtype-generics >= 0.5 && < 0.6, monoid-extras >= 0.2 && < 0.5 hs-source-dirs: src other-extensions: GeneralizedNewtypeDeriving, @@ -52,3 +52,14 @@ TypeOperators, FlexibleContexts, DeriveDataTypeable +test-suite test + default-language: Haskell2010 + type: exitcode-stdio-1.0 + main-is: Test.hs + hs-source-dirs: test + build-depends: base, + QuickCheck, + testing-feat, + monoid-extras, + semigroups, + dual-tree diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dual-tree-0.2.0.9/src/Data/Tree/DUAL/Internal.hs new/dual-tree-0.2.1/src/Data/Tree/DUAL/Internal.hs --- old/dual-tree-0.2.0.9/src/Data/Tree/DUAL/Internal.hs 2014-05-19 22:45:06.000000000 +0200 +++ new/dual-tree-0.2.1/src/Data/Tree/DUAL/Internal.hs 2017-07-03 16:52:07.000000000 +0200 @@ -5,6 +5,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeOperators #-} +{-# LANGUAGE TypeFamilies #-} ----------------------------------------------------------------------------- -- | @@ -83,7 +84,8 @@ newtype DAct d = DAct { unDAct :: d } -instance Newtype (DAct d) d where +instance Newtype (DAct d) where + type O (DAct d) = d pack = DAct unpack = unDAct @@ -101,7 +103,8 @@ newtype DUALTreeU d u a l = DUALTreeU { unDUALTreeU :: (u, DUALTreeNE d u a l) } deriving (Functor, Semigroup, Typeable, Show, Eq) -instance Newtype (DUALTreeU d u a l) (u, DUALTreeNE d u a l) where +instance Newtype (DUALTreeU d u a l) where + type O (DUALTreeU d u a l) = (u, DUALTreeNE d u a l) pack = DUALTreeU unpack = unDUALTreeU @@ -149,7 +152,8 @@ newtype DUALTree d u a l = DUALTree { unDUALTree :: Option (DUALTreeU d u a l) } deriving ( Functor, Semigroup, Typeable, Show, Eq ) -instance Newtype (DUALTree d u a l) (Option (DUALTreeU d u a l)) where +instance Newtype (DUALTree d u a l) where + type O (DUALTree d u a l) = Option (DUALTreeU d u a l) pack = DUALTree unpack = unDUALTree diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dual-tree-0.2.0.9/test/Test.hs new/dual-tree-0.2.1/test/Test.hs --- old/dual-tree-0.2.0.9/test/Test.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/dual-tree-0.2.1/test/Test.hs 2017-07-03 16:52:07.000000000 +0200 @@ -0,0 +1,112 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE StandaloneDeriving #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +{-# OPTIONS_GHC -fno-warn-missing-signatures #-} +{-# OPTIONS_GHC -fno-warn-deprecations #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} + +import Data.Functor +import Data.Maybe +import Data.Typeable + +import Test.QuickCheck.All (quickCheckAll) +import Test.QuickCheck hiding ((===)) +import Test.Feat + +import Data.List.NonEmpty (NonEmpty) +import qualified Data.List.NonEmpty as NEL +import Data.Monoid.Action +import Data.Semigroup +import Data.Tree.DUAL + +data DUALTreeExpr d u a l = + EEmpty + | ELeaf u l + | ELeafU u + | EConcat (NonEmpty (DUALTreeExpr d u a l)) + | EAct d (DUALTreeExpr d u a l) + | EAnnot a (DUALTreeExpr d u a l) + deriving (Show, Typeable) + +deriveEnumerable ''NonEmpty +deriveEnumerable ''DUALTreeExpr + +buildTree :: (Semigroup u, Semigroup d, Action d u) + => DUALTreeExpr d u a l -> DUALTree d u a l +buildTree EEmpty = empty +buildTree (ELeaf u l) = leaf u l +buildTree (ELeafU u) = leafU u +buildTree (EConcat ts) = sconcat (NEL.map buildTree ts) +buildTree (EAct d t) = applyD d (buildTree t) +buildTree (EAnnot a t) = annot a (buildTree t) + +-- buildTree' :: DUALTreeExpr D U () Bool -> DUALTree D U () Bool +-- buildTree' = buildTree + +instance Num a => Action (Product a) (Sum a) where + act (Product p) (Sum s) = Sum (p * s) + +type U = Sum Int +type D = Product Int + +deriving instance Typeable Sum +deriving instance Typeable Product + +deriveEnumerable ''Sum +deriveEnumerable ''Product + +type T = DUALTree D U Bool Bool + +instance Arbitrary T where + arbitrary = buildTree <$> sized uniform + +prop_leaf_u :: U -> Bool +prop_leaf_u u = getU (leaf u ()) == Just u + +prop_leafU_u :: U -> Bool +prop_leafU_u u = getU (leafU u) == Just u + +prop_applyUpre :: U -> T -> Bool +prop_applyUpre u t = getU (applyUpre u t) == Just (u <> fromMaybe mempty (getU t)) + +prop_applyUpost :: U -> T -> Bool +prop_applyUpost u t = getU (applyUpost u t) == Just (fromMaybe mempty (getU t) <> u) + +-------------------------------------------------- +-- Monoid laws +-------------------------------------------------- + +prop_mempty_idL :: T -> Bool +prop_mempty_idL t = mempty <> t == t + +prop_mempty_idR :: T -> Bool +prop_mempty_idR t = t <> mempty == t + +infix 4 === +t1 === t2 = flatten t1 == flatten t2 + +-- mappend is associative up to flattening. +prop_mappend_assoc :: T -> T -> T -> Bool +prop_mappend_assoc t1 t2 t3 = (t1 <> t2) <> t3 === t1 <> (t2 <> t3) + +-------------------------------------------------- +-- Action laws +-------------------------------------------------- + +prop_mempty_act :: T -> Bool +prop_mempty_act t = applyD mempty t === t + +prop_mappend_act :: D -> D -> T -> Bool +prop_mappend_act d1 d2 t = applyD d1 (applyD d2 t) == applyD (d1 <> d2) t + +prop_act_mempty :: D -> Bool +prop_act_mempty d = applyD d (mempty :: T) == mempty + +prop_act_mappend :: D -> T -> T -> Bool +prop_act_mappend d t1 t2 = applyD d (t1 <> t2) === applyD d t1 <> applyD d t2 + +return [] +main = $quickCheckAll
