Hello community,

here is the log from the commit of package ghc-persistent-template for 
openSUSE:Factory checked in at 2016-04-28 16:57:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-persistent-template (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-persistent-template.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-persistent-template"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/ghc-persistent-template/ghc-persistent-template.changes
  2016-03-18 21:41:14.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.ghc-persistent-template.new/ghc-persistent-template.changes
     2016-04-28 17:02:12.000000000 +0200
@@ -1,0 +2,8 @@
+Tue Apr 26 08:36:30 UTC 2016 - [email protected]
+
+-update to 2.1.8
+* Support for GHC 8
+* aeson 0.11
+* transformers 0.5
+
+-------------------------------------------------------------------

Old:
----
  persistent-template-2.1.6.tar.gz

New:
----
  persistent-template-2.1.8.tar.gz

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

Other differences:
------------------
++++++ ghc-persistent-template.spec ++++++
--- /var/tmp/diff_new_pack.mBLjqf/_old  2016-04-28 17:02:14.000000000 +0200
+++ /var/tmp/diff_new_pack.mBLjqf/_new  2016-04-28 17:02:14.000000000 +0200
@@ -20,7 +20,7 @@
 %bcond_with tests
 
 Name:           ghc-persistent-template
-Version:        2.1.6
+Version:        2.1.8
 Release:        0
 Summary:        Type-safe, non-relational, multi-backend persistence
 Group:          System/Libraries

++++++ persistent-template-2.1.6.tar.gz -> persistent-template-2.1.8.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/persistent-template-2.1.6/ChangeLog.md 
new/persistent-template-2.1.8/ChangeLog.md
--- old/persistent-template-2.1.6/ChangeLog.md  2016-03-08 09:17:27.000000000 
+0100
+++ new/persistent-template-2.1.8/ChangeLog.md  2016-04-23 09:41:14.000000000 
+0200
@@ -1,3 +1,7 @@
+## 2.1.7
+
+* Support for GHC 8 [#556](https://github.com/yesodweb/persistent/issues/556)
+
 ## 2.1.6
 
 * aeson 0.11
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/persistent-template-2.1.6/Database/Persist/TH.hs 
new/persistent-template-2.1.8/Database/Persist/TH.hs
--- old/persistent-template-2.1.6/Database/Persist/TH.hs        2016-03-08 
09:17:27.000000000 +0100
+++ new/persistent-template-2.1.8/Database/Persist/TH.hs        2016-04-23 
09:42:28.000000000 +0200
@@ -47,7 +47,11 @@
 import Database.Persist
 import Database.Persist.Sql (Migration, migrate, SqlBackend, PersistFieldSql)
 import Database.Persist.Quasi
-import Language.Haskell.TH.Lib (varE)
+import Language.Haskell.TH.Lib (
+#if MIN_VERSION_template_haskell(2,11,0)
+    conT,
+#endif
+    varE)
 import Language.Haskell.TH.Quote
 import Language.Haskell.TH.Syntax
 import Data.Char (toLower, toUpper)
@@ -396,14 +400,21 @@
         Just (a, b) -> cons (toUpper a) b
         Nothing -> t
 
-dataTypeDec :: MkPersistSettings -> EntityDef -> Dec
-dataTypeDec mps t =
-    DataD [] nameFinal paramsFinal constrs
-    $ map (mkName . unpack) $ entityDerives t
+dataTypeDec :: MkPersistSettings -> EntityDef -> Q Dec
+dataTypeDec mps t = do
+    let names = map (mkName . unpack) $ entityDerives t
+#if MIN_VERSION_template_haskell(2,11,0)
+    DataD [] nameFinal paramsFinal
+                Nothing
+                constrs
+                <$> mapM conT names
+#else
+    return $ DataD [] nameFinal paramsFinal constrs names
+#endif
   where
     mkCol x fd@FieldDef {..} =
         (mkName $ unpack $ recName mps x fieldHaskell,
-         if fieldStrict then IsStrict else NotStrict,
+         if fieldStrict then isStrict else notStrict,
          maybeIdType mps fd Nothing Nothing
         )
     (nameFinal, paramsFinal)
@@ -420,7 +431,7 @@
 
     sumCon fd = NormalC
         (sumConstrName mps t fd)
-        [(NotStrict, maybeIdType mps fd Nothing Nothing)]
+        [(notStrict, maybeIdType mps fd Nothing Nothing)]
 
 sumConstrName :: MkPersistSettings -> EntityDef -> FieldDef -> Name
 sumConstrName mps t FieldDef {..} = mkName $ unpack $ concat
@@ -435,6 +446,9 @@
 uniqueTypeDec mps t =
     DataInstD [] ''Unique
         [genericDataType mps (entityHaskell t) backendT]
+#if MIN_VERSION_template_haskell(2,11,0)
+            Nothing
+#endif
             (map (mkUnique mps t) $ entityUniques t)
             []
 
@@ -449,7 +463,7 @@
 
     go :: (FieldDef, IsNullable) -> (Strict, Type)
     go (_, Nullable _) | not force = error nullErrMsg
-    go (fd, y) = (NotStrict, maybeIdType mps fd Nothing (Just y))
+    go (fd, y) = (notStrict, maybeIdType mps fd Nothing (Just y))
 
     lookup3 :: Text -> [FieldDef] -> (FieldDef, IsNullable)
     lookup3 s [] =
@@ -691,9 +705,16 @@
                         bi <- backendKeyI
                         return (bi, allInstances)
 
+#if MIN_VERSION_template_haskell(2,11,0)
+    cxti <- mapM conT i
+    let kd = if useNewtype
+               then NewtypeInstD [] k [recordType] Nothing dec cxti
+               else DataInstD    [] k [recordType] Nothing [dec] cxti
+#else
     let kd = if useNewtype
                then NewtypeInstD [] k [recordType] dec i
                else DataInstD    [] k [recordType] [dec] i
+#endif
     return (kd, instDecs)
   where
     keyConE = keyConExp t
@@ -827,9 +848,9 @@
     backendKeyType
         | mpsGeneric mps = ConT ''BackendKey `AppT` backendT
         | otherwise      = ConT ''BackendKey `AppT` mpsBackend mps
-    idKeyVar ft = (unKeyName t, NotStrict, ft)
+    idKeyVar ft = (unKeyName t, notStrict, ft)
     primaryKeyVar fd = ( keyFieldName mps t fd
-                       , NotStrict
+                       , notStrict
                        , ftToType $ fieldType fd
                        )
 
@@ -939,11 +960,12 @@
     let instanceConstraint = if not (mpsGeneric mps) then [] else
           [mkClassP ''PersistStore [backendT]]
 
+    dtd <- dataTypeDec mps t
     return $ addSyn $
-       dataTypeDec mps t : mconcat fkc `mappend`
+       dtd : mconcat fkc `mappend`
       ([ TySynD (keyIdName t) [] $
             ConT ''Key `AppT` ConT (mkName nameS)
-      , InstanceD instanceConstraint clazz $
+      , instanceD instanceConstraint clazz $
         [ uniqueTypeDec mps t
         , keyTypeDec
         , keyToValues'
@@ -960,6 +982,9 @@
             [ genDataType
             , VarT $ mkName "typ"
             ]
+#if MIN_VERSION_template_haskell(2,11,0)
+            Nothing
+#endif
             (map fst fields)
             []
         , FunD 'persistFieldDef (map snd fields)
@@ -1182,7 +1207,7 @@
         let entityT = genericDataType mps name backendT
 
         return $
-            InstanceD
+            instanceD
             [ mkClassP ''PersistQuery [backendT]
             , mkEqualP (ConT ''PersistEntityBackend `AppT` entityT) backendT
             ]
@@ -1226,7 +1251,7 @@
               -> Bool -- ^ include PersistStore backend constraint
               -> Type -> [Dec] -> Dec
 typeInstanceD clazz hasBackend typ =
-    InstanceD ctx (ConT clazz `AppT` typ)
+    instanceD ctx (ConT clazz `AppT` typ)
   where
     ctx
         | hasBackend = [mkClassP ''PersistStore [backendT]]
@@ -1560,6 +1585,27 @@
 mkEqualP = EqualP
 #endif
 
+#if MIN_VERSION_template_haskell(2,11,0)
+notStrict :: Bang
+notStrict = Bang NoSourceUnpackedness NoSourceStrictness
+
+isStrict :: Bang
+isStrict = Bang NoSourceUnpackedness SourceStrict
+#else
+notStrict :: Strict
+notStrict = NotStrict
+
+isStrict :: Strict
+isStrict = IsStrict
+#endif
+
+instanceD :: Cxt -> Type -> [Dec] -> Dec
+#if MIN_VERSION_template_haskell(2,11,0)
+instanceD = InstanceD Nothing
+#else
+instanceD = InstanceD
+#endif
+
 -- entityUpdates :: EntityDef -> [(HaskellName, FieldType, IsNullable, 
PersistUpdate)]
 -- entityUpdates =
 --     concatMap go . entityFields
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/persistent-template-2.1.6/persistent-template.cabal 
new/persistent-template-2.1.8/persistent-template.cabal
--- old/persistent-template-2.1.6/persistent-template.cabal     2016-03-08 
09:17:27.000000000 +0100
+++ new/persistent-template-2.1.8/persistent-template.cabal     2016-04-23 
09:42:38.000000000 +0200
@@ -1,5 +1,5 @@
 name:            persistent-template
-version:         2.1.6
+version:         2.1.8
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <[email protected]>


Reply via email to