Hello community,
here is the log from the commit of package ghc-data-default-class for
openSUSE:Factory checked in at 2016-10-19 13:03:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-data-default-class (Old)
and /work/SRC/openSUSE:Factory/.ghc-data-default-class.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-data-default-class"
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-data-default-class/ghc-data-default-class.changes
2016-07-21 08:14:57.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-data-default-class.new/ghc-data-default-class.changes
2016-10-19 13:03:48.000000000 +0200
@@ -1,0 +2,5 @@
+Thu Sep 15 06:43:32 UTC 2016 - [email protected]
+
+- Update to version 0.1.2.0 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
data-default-class-0.0.1.tar.gz
New:
----
data-default-class-0.1.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-data-default-class.spec ++++++
--- /var/tmp/diff_new_pack.XsNQ28/_old 2016-10-19 13:03:50.000000000 +0200
+++ /var/tmp/diff_new_pack.XsNQ28/_new 2016-10-19 13:03:50.000000000 +0200
@@ -18,11 +18,11 @@
%global pkg_name data-default-class
Name: ghc-%{pkg_name}
-Version: 0.0.1
+Version: 0.1.2.0
Release: 0
Summary: A class for types with a default value
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
@@ -47,15 +47,12 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
%post devel
%ghc_pkg_recache
++++++ data-default-class-0.0.1.tar.gz -> data-default-class-0.1.2.0.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/data-default-class-0.0.1/Data/Default/Class.hs
new/data-default-class-0.1.2.0/Data/Default/Class.hs
--- old/data-default-class-0.0.1/Data/Default/Class.hs 2013-04-02
21:58:04.000000000 +0200
+++ new/data-default-class-0.1.2.0/Data/Default/Class.hs 2016-06-26
00:55:15.000000000 +0200
@@ -29,12 +29,123 @@
-}
+{-# LANGUAGE CPP #-}
+
+#define HAVE_GHC_GENERICS (__GLASGOW_HASKELL__ >= 704)
+
+#if HAVE_GHC_GENERICS
+{-# LANGUAGE DefaultSignatures, TypeOperators, FlexibleContexts #-}
+#endif
+
module Data.Default.Class (
-- | This module defines a class for types with a default value.
+-- It also defines 'Default' instances for the types 'Int', 'Int8',
+-- 'Int16', 'Int32', 'Int64', 'Word', 'Word8', 'Word16', 'Word32', 'Word64',
+-- 'Integer', 'Float', 'Double', 'Ratio', 'Complex', 'CShort', 'CUShort',
+-- 'CInt', 'CUInt', 'CLong', 'CULong', 'CLLong', 'CULLong', 'CPtrdiff',
+-- 'CSize', 'CSigAtomic', 'CIntPtr', 'CUIntPtr', 'CIntMax', 'CUIntMax',
+-- 'CClock', 'CTime', 'CUSeconds', 'CSUSeconds', 'CFloat', 'CDouble', '(->)',
+-- 'IO', 'Maybe', '()', '[]', 'Ordering', 'Any', 'All', 'Last', 'First', 'Sum',
+-- 'Product', 'Endo', 'Dual', and tuples.
Default(..)
) where
+import Data.Int
+import Data.Word
+import Data.Monoid
+import Data.Ratio
+import Data.Complex
+import Foreign.C.Types
+
+#if HAVE_GHC_GENERICS
+import GHC.Generics
+
+class GDefault f where
+ gdef :: f a
+
+instance GDefault U1 where
+ gdef = U1
+
+instance (Default a) => GDefault (K1 i a) where
+ gdef = K1 def
+
+instance (GDefault a, GDefault b) => GDefault (a :*: b) where
+ gdef = gdef :*: gdef
+
+instance (GDefault a) => GDefault (M1 i c a) where
+ gdef = M1 gdef
+#endif
+
-- | A class for types with a default value.
class Default a where
-- | The default value for this type.
def :: a
+
+#if HAVE_GHC_GENERICS
+ default def :: (Generic a, GDefault (Rep a)) => a
+ def = to gdef
+#endif
+
+instance Default Int where def = 0
+instance Default Int8 where def = 0
+instance Default Int16 where def = 0
+instance Default Int32 where def = 0
+instance Default Int64 where def = 0
+instance Default Word where def = 0
+instance Default Word8 where def = 0
+instance Default Word16 where def = 0
+instance Default Word32 where def = 0
+instance Default Word64 where def = 0
+instance Default Integer where def = 0
+instance Default Float where def = 0
+instance Default Double where def = 0
+instance (Integral a) => Default (Ratio a) where def = 0
+instance (Default a, RealFloat a) => Default (Complex a) where def = def :+ def
+
+instance Default CShort where def = 0
+instance Default CUShort where def = 0
+instance Default CInt where def = 0
+instance Default CUInt where def = 0
+instance Default CLong where def = 0
+instance Default CULong where def = 0
+instance Default CLLong where def = 0
+instance Default CULLong where def = 0
+instance Default CPtrdiff where def = 0
+instance Default CSize where def = 0
+instance Default CSigAtomic where def = 0
+instance Default CIntPtr where def = 0
+instance Default CUIntPtr where def = 0
+instance Default CIntMax where def = 0
+instance Default CUIntMax where def = 0
+instance Default CClock where def = 0
+instance Default CTime where def = 0
+#if MIN_VERSION_base(4, 4, 0)
+instance Default CUSeconds where def = 0
+instance Default CSUSeconds where def = 0
+#endif
+instance Default CFloat where def = 0
+instance Default CDouble where def = 0
+
+instance (Default r) => Default (e -> r) where def = const def
+instance (Default a) => Default (IO a) where def = return def
+
+instance Default (Maybe a) where def = Nothing
+
+instance Default () where def = mempty
+instance Default [a] where def = mempty
+instance Default Ordering where def = mempty
+instance Default Any where def = mempty
+instance Default All where def = mempty
+instance Default (Last a) where def = mempty
+instance Default (First a) where def = mempty
+instance (Num a) => Default (Sum a) where def = mempty
+instance (Num a) => Default (Product a) where def = mempty
+instance Default (Endo a) where def = mempty
+
+instance (Default a) => Default (Dual a) where def = Dual def
+instance (Default a, Default b) => Default (a, b) where def = (def, def)
+instance (Default a, Default b, Default c) => Default (a, b, c) where def =
(def, def, def)
+instance (Default a, Default b, Default c, Default d) => Default (a, b, c, d)
where def = (def, def, def, def)
+instance (Default a, Default b, Default c, Default d, Default e) => Default
(a, b, c, d, e) where def = (def, def, def, def, def)
+instance (Default a, Default b, Default c, Default d, Default e, Default f) =>
Default (a, b, c, d, e, f) where def = (def, def, def, def, def, def)
+instance (Default a, Default b, Default c, Default d, Default e, Default f,
Default g) => Default (a, b, c, d, e, f, g) where def = (def, def, def, def,
def, def, def)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/data-default-class-0.0.1/LICENSE
new/data-default-class-0.1.2.0/LICENSE
--- old/data-default-class-0.0.1/LICENSE 2013-04-02 21:58:04.000000000
+0200
+++ new/data-default-class-0.1.2.0/LICENSE 2016-06-26 00:55:15.000000000
+0200
@@ -14,13 +14,13 @@
may be used to endorse or promote products derived from this software
without specific prior written permission.
-THIS SOFTWARE IS PROVIDED BY LUKAS MAI AND CONTRIBUTORS "AS IS" AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/data-default-class-0.0.1/data-default-class.cabal
new/data-default-class-0.1.2.0/data-default-class.cabal
--- old/data-default-class-0.0.1/data-default-class.cabal 2013-04-02
21:58:04.000000000 +0200
+++ new/data-default-class-0.1.2.0/data-default-class.cabal 2016-06-26
00:55:15.000000000 +0200
@@ -1,5 +1,5 @@
Name: data-default-class
-Version: 0.0.1
+Version: 0.1.2.0
Cabal-Version: >= 1.6
Category: Data
Synopsis: A class for types with a default value
@@ -15,4 +15,7 @@
Library
Build-Depends: base >=2 && <5
+ if impl(ghc == 7.4.*)
+ -- for GHC.Generics
+ Build-Depends: ghc-prim
Exposed-Modules: Data.Default.Class