Hello community,

here is the log from the commit of package ghc-store for openSUSE:Factory 
checked in at 2019-06-12 13:18:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-store (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-store.new.4811 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-store"

Wed Jun 12 13:18:42 2019 rev:8 rq:709202 version:0.5.1.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-store/ghc-store.changes      2019-04-28 
20:13:51.962403093 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-store.new.4811/ghc-store.changes    
2019-06-12 13:18:45.172566626 +0200
@@ -1,0 +2,10 @@
+Wed May 22 02:02:01 UTC 2019 - [email protected]
+
+- Update store to version 0.5.1.1.
+  ## 0.5.1.1
+
+  * Update to the instances for generics, to improve error messages for
+    sum types with more than 255 constructors.  See
+    [#141](https://github.com/fpco/store/issues/141)
+
+-------------------------------------------------------------------

Old:
----
  store-0.5.1.0.tar.gz
  store.cabal

New:
----
  store-0.5.1.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-store.spec ++++++
--- /var/tmp/diff_new_pack.lRKFta/_old  2019-06-12 13:18:45.744566365 +0200
+++ /var/tmp/diff_new_pack.lRKFta/_new  2019-06-12 13:18:45.748566364 +0200
@@ -19,14 +19,13 @@
 %global pkg_name store
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.5.1.0
+Version:        0.5.1.1
 Release:        0
 Summary:        Fast binary serialization
 License:        MIT
 Group:          Development/Libraries/Haskell
 URL:            https://hackage.haskell.org/package/%{pkg_name}
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
-Source1:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-async-devel
@@ -88,7 +87,6 @@
 
 %prep
 %setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
 
 %build
 %ghc_lib_build

++++++ store-0.5.1.0.tar.gz -> store-0.5.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/store-0.5.1.0/ChangeLog.md 
new/store-0.5.1.1/ChangeLog.md
--- old/store-0.5.1.0/ChangeLog.md      2019-04-24 21:03:02.000000000 +0200
+++ new/store-0.5.1.1/ChangeLog.md      2019-05-21 07:04:38.000000000 +0200
@@ -1,5 +1,11 @@
 # ChangeLog
 
+## 0.5.1.1
+
+* Update to the instances for generics, to improve error messages for
+  sum types with more than 255 constructors.  See
+  [#141](https://github.com/fpco/store/issues/141)
+
 ## 0.5.1.0
 
 * Update to TH to support sum types with more than 62 constructors.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/store-0.5.1.0/src/Data/Store/Impl.hs 
new/store-0.5.1.1/src/Data/Store/Impl.hs
--- old/store-0.5.1.0/src/Data/Store/Impl.hs    2019-04-24 20:58:44.000000000 
+0200
+++ new/store-0.5.1.1/src/Data/Store/Impl.hs    2019-05-21 07:02:09.000000000 
+0200
@@ -1,4 +1,6 @@
 {-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE ConstraintKinds #-}
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE DataKinds #-}
 {-# LANGUAGE DefaultSignatures #-}
 {-# LANGUAGE DeriveDataTypeable #-}
@@ -28,6 +30,7 @@
 import           Data.Typeable (Typeable, typeRep)
 import           Data.Word
 import           Foreign.Storable (Storable, sizeOf)
+import           GHC.Exts (Constraint)
 import           GHC.Generics
 import           GHC.TypeLits
 import           Prelude
@@ -262,21 +265,37 @@
 -- FIXME: check that this type level stuff dosen't get turned into
 -- costly runtime computation
 
-instance (SumArity (a :+: b) <= 255, GStoreSizeSum 0 (a :+: b))
+instance (FitsInByte (SumArity (a :+: b)), GStoreSizeSum 0 (a :+: b))
          => GStoreSize (a :+: b) where
     gsize = VarSize $ \x -> sizeOf (undefined :: Word8) + gsizeSum x (Proxy :: 
Proxy 0)
     {-# INLINE gsize #-}
-instance (SumArity (a :+: b) <= 255, GStorePokeSum 0 (a :+: b))
+instance (FitsInByte (SumArity (a :+: b)), GStorePokeSum 0 (a :+: b))
          => GStorePoke (a :+: b) where
     gpoke x = gpokeSum x (Proxy :: Proxy 0)
     {-# INLINE gpoke #-}
-instance (SumArity (a :+: b) <= 255, GStorePeekSum 0 (a :+: b))
+instance (FitsInByte (SumArity (a :+: b)), GStorePeekSum 0 (a :+: b))
          => GStorePeek (a :+: b) where
     gpeek = do
         tag <- peekStorable
         gpeekSum tag (Proxy :: Proxy 0)
     {-# INLINE gpeek #-}
 
+-- See https://github.com/fpco/store/issues/141 - this constraint type
+-- family machinery improves error messages for generic deriving on
+-- sum types with many constructors.
+
+type FitsInByte n = FitsInByteResult (n <=? 255)
+
+type family FitsInByteResult (b :: Bool) :: Constraint where
+    FitsInByteResult True = ()
+    FitsInByteResult False = TypeErrorMessage
+        "Generic deriving of Store instances can only be used on datatypes 
with fewer than 256 constructors."
+
+type family TypeErrorMessage (a :: Symbol) :: Constraint where
+#if MIN_VERSION_base(4,9,0)
+    TypeErrorMessage a = TypeError (Text a)
+#endif
+
 -- Similarly to splitting up the generic class into multiple classes, we
 -- also split up the one for sum types.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/store-0.5.1.0/store.cabal 
new/store-0.5.1.1/store.cabal
--- old/store-0.5.1.0/store.cabal       2019-04-24 21:05:35.000000000 +0200
+++ new/store-0.5.1.1/store.cabal       2019-05-21 07:05:18.000000000 +0200
@@ -4,10 +4,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 5c038df3338fc7661664ddc082dde9288b48c1153a7680a63b2aed528590535e
+-- hash: a18e85521a544ee521dc7788e9b2194c7c3ec0efbeb6092e401782d962ea22d3
 
 name:           store
-version:        0.5.1.0
+version:        0.5.1.1
 synopsis:       Fast binary serialization
 category:       Serialization, Data
 homepage:       https://github.com/fpco/store#readme


Reply via email to