Hello community, here is the log from the commit of package ghc-th-utilities for openSUSE:Leap:15.2 checked in at 2020-02-19 18:41:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/ghc-th-utilities (Old) and /work/SRC/openSUSE:Leap:15.2/.ghc-th-utilities.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-th-utilities" Wed Feb 19 18:41:45 2020 rev:13 rq:771495 version:0.2.3.1 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/ghc-th-utilities/ghc-th-utilities.changes 2020-01-15 15:02:41.829818615 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.ghc-th-utilities.new.26092/ghc-th-utilities.changes 2020-02-19 18:41:46.190231872 +0100 @@ -1,0 +2,33 @@ +Fri Nov 8 16:15:00 UTC 2019 - Peter Simons <[email protected]> + +- Drop obsolete group attributes. + +------------------------------------------------------------------- +Fri Oct 18 02:02:42 UTC 2019 - [email protected] + +- Update th-utilities to version 0.2.3.1. + ## 0.2.3.1 + + * Compatibility with GHC-8.8 + +------------------------------------------------------------------- +Mon May 6 02:01:42 UTC 2019 - [email protected] + +- Update th-utilities to version 0.2.3.0. + ## 0.2.3.0 + + * Improved fix to the type variable behavior with GHC <= 7.10. Uses + `Any` in place of type variables instead of `()`, to allow for more + kinds than just `*` and `Constraint`. + + ## 0.2.2.0 + + * Fixes derive and instantiator mechanisms to work with ghc 7.10 and + earlier. Previously, invocation was broken when type variables were + used. + + * Fixes `freeVarsT` - it now looks through more constructors of `Type`. + + * Adds `dequalifyTyVars` to dequalify every type variable. + +------------------------------------------------------------------- Old: ---- th-utilities-0.2.1.0.tar.gz New: ---- th-utilities-0.2.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-th-utilities.spec ++++++ --- /var/tmp/diff_new_pack.JOHPBJ/_old 2020-02-19 18:41:46.870233297 +0100 +++ /var/tmp/diff_new_pack.JOHPBJ/_new 2020-02-19 18:41:46.870233297 +0100 @@ -19,11 +19,10 @@ %global pkg_name th-utilities %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.2.1.0 +Version: 0.2.3.1 Release: 0 Summary: Collection of useful functions for use with Template Haskell 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 BuildRequires: ghc-Cabal-devel @@ -47,7 +46,6 @@ %package devel Summary: Haskell %{pkg_name} library development files -Group: Development/Libraries/Haskell Requires: %{name} = %{version}-%{release} Requires: ghc-compiler = %{ghc_version} Requires(post): ghc-compiler = %{ghc_version} ++++++ th-utilities-0.2.1.0.tar.gz -> th-utilities-0.2.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/th-utilities-0.2.1.0/ChangeLog.md new/th-utilities-0.2.3.1/ChangeLog.md --- old/th-utilities-0.2.1.0/ChangeLog.md 2019-01-09 05:57:34.000000000 +0100 +++ new/th-utilities-0.2.3.1/ChangeLog.md 2019-10-17 05:23:43.000000000 +0200 @@ -1,5 +1,25 @@ # ChangeLog +## 0.2.3.1 + +* Compatibility with GHC-8.8 + +## 0.2.3.0 + +* Improved fix to the type variable behavior with GHC <= 7.10. Uses + `Any` in place of type variables instead of `()`, to allow for more + kinds than just `*` and `Constraint`. + +## 0.2.2.0 + +* Fixes derive and instantiator mechanisms to work with ghc 7.10 and + earlier. Previously, invocation was broken when type variables were + used. + +* Fixes `freeVarsT` - it now looks through more constructors of `Type`. + +* Adds `dequalifyTyVars` to dequalify every type variable. + ## 0.2.0.1 * Fixes build on 7.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/th-utilities-0.2.1.0/src/TH/Derive.hs new/th-utilities-0.2.3.1/src/TH/Derive.hs --- old/th-utilities-0.2.1.0/src/TH/Derive.hs 2019-01-09 05:54:24.000000000 +0100 +++ new/th-utilities-0.2.3.1/src/TH/Derive.hs 2019-10-17 05:21:51.000000000 +0200 @@ -67,6 +67,7 @@ import TH.Utilities import TH.Derive.Internal import TH.Derive.Storable () +import GHC.Exts (Any) --TODO: support deriving on constraint kinds, for concision! @@ -84,12 +85,12 @@ toStmt (varName, dec) = case fromPlainInstanceD dec of Just (preds, AppT (ConT ((== ''Deriving) -> True)) cls, []) -> bindS (varP varName) - [e| runDeriver $(proxyE (return cls)) + [e| runDeriver $(proxyE (return (tyVarsToAny cls))) preds cls |] Just (preds, ty, decs) -> bindS (varP varName) - [e| runInstantiator $(proxyE (return ty)) + [e| runInstantiator $(proxyE (return (tyVarsToAny ty))) preds ty decs |] @@ -97,6 +98,18 @@ "Expected deriver or instantiator, instead got:\n" ++ show dec +-- | Turn type variables into uses of 'Any'. +-- +-- The purpose of this is to avoid errors such as described in +-- https://github.com/fpco/store/issues/140 . The problem is that +-- older GHC versions (<= 7.10) have a bug where they expect type +-- variables in expressions to be in scope. +tyVarsToAny :: Data a => a -> a +tyVarsToAny = everywhere (id `extT` modifyType) + where + modifyType (VarT _) = ConT ''Any + modifyType ty = ty + -- | Useful function for defining 'Instantiator' instances. It uses -- 'Data' to generically replace references to the methods with plain -- 'Name's. This is handy when you are putting the definitions passed to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/th-utilities-0.2.1.0/src/TH/ReifySimple.hs new/th-utilities-0.2.3.1/src/TH/ReifySimple.hs --- old/th-utilities-0.2.1.0/src/TH/ReifySimple.hs 2019-01-09 05:54:24.000000000 +0100 +++ new/th-utilities-0.2.3.1/src/TH/ReifySimple.hs 2019-10-17 05:21:51.000000000 +0200 @@ -233,18 +233,24 @@ Just $ DataFamily name (map tyVarBndrName tvs) (map go insts) _ -> Nothing where -#if MIN_VERSION_template_haskell(2,11,0) - go (NewtypeInstD preds name params _kind con _deriving) = +#if MIN_VERSION_template_haskell(2,15,0) + go (NewtypeInstD preds _ lhs _kind con _deriving) + | ConT name:params <- unAppsT lhs +#elif MIN_VERSION_template_haskell(2,11,0) + go (NewtypeInstD preds name params _kind con _deriving) #else - go (NewtypeInstD preds name params con _deriving) = + go (NewtypeInstD preds name params con _deriving) #endif - DataInst name preds params (conToDataCons con) -#if MIN_VERSION_template_haskell(2,11,0) - go (DataInstD preds name params _kind cons _deriving) = + = DataInst name preds params (conToDataCons con) +#if MIN_VERSION_template_haskell(2,15,0) + go (DataInstD preds _ lhs _kind cons _deriving) + | ConT name:params <- unAppsT lhs +#elif MIN_VERSION_template_haskell(2,11,0) + go (DataInstD preds name params _kind cons _deriving) #else - go (DataInstD preds name params cons _deriving) = + go (DataInstD preds name params cons _deriving) #endif - DataInst name preds params (concatMap conToDataCons cons) + = DataInst name preds params (concatMap conToDataCons cons) go info' = error $ "Unexpected instance in FamilyI in infoToDataInsts:\n" ++ pprint info' @@ -263,8 +269,23 @@ #endif _ -> Nothing where +#if MIN_VERSION_template_haskell(2,15,0) + goEqn _ (TySynEqn _ lhs ty) + | ConT name:params <- unAppsT lhs + = TypeInst name params ty + | otherwise + = error $ "Unexpected type family instance head: " ++ pprint lhs +#else goEqn name (TySynEqn params ty) = TypeInst name params ty +#endif + +#if MIN_VERSION_template_haskell(2,15,0) + go (TySynInstD (TySynEqn _ lhs ty)) + | ConT name:params <- unAppsT lhs + = TypeInst name params ty +#else go (TySynInstD name (TySynEqn params ty)) = TypeInst name params ty +#endif go info' = error $ "Unexpected instance in FamilyI in infoToTypeInsts:\n" ++ pprint info' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/th-utilities-0.2.1.0/src/TH/Utilities.hs new/th-utilities-0.2.3.1/src/TH/Utilities.hs --- old/th-utilities-0.2.1.0/src/TH/Utilities.hs 2019-01-09 05:54:24.000000000 +0100 +++ new/th-utilities-0.2.3.1/src/TH/Utilities.hs 2019-10-17 05:21:51.000000000 +0200 @@ -94,17 +94,18 @@ dequalify :: Name -> Name dequalify = mkName . nameBase +-- | Apply 'dequalify' to every type variable. +dequalifyTyVars :: Data a => a -> a +dequalifyTyVars = everywhere (id `extT` modifyType) + where + modifyType (VarT n) = VarT (dequalify n) + modifyType ty = ty + -- | Get the free type variables of a 'Type'. freeVarsT :: Type -> [Name] freeVarsT (ForallT tvs _ ty) = filter (`notElem` (map tyVarBndrName tvs)) (freeVarsT ty) -freeVarsT (AppT l r) = freeVarsT l ++ freeVarsT r -freeVarsT (SigT ty k) = freeVarsT ty ++ freeVarsT k freeVarsT (VarT n) = [n] -#if MIN_VERSION_template_haskell(2,11,0) -freeVarsT (InfixT x n r) = freeVarsT x ++ freeVarsT r -freeVarsT (UInfixT x n r) = freeVarsT x ++ freeVarsT r -#endif -freeVarsT _ = [] +freeVarsT ty = concat $ gmapQ (const [] `extQ` freeVarsT) ty -- | Utility to conveniently handle change to 'InstanceD' API in -- template-haskell-2.11.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/th-utilities-0.2.1.0/th-utilities.cabal new/th-utilities-0.2.3.1/th-utilities.cabal --- old/th-utilities-0.2.1.0/th-utilities.cabal 2019-01-09 06:13:28.000000000 +0100 +++ new/th-utilities-0.2.3.1/th-utilities.cabal 2019-10-17 05:24:31.000000000 +0200 @@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack -- --- hash: f65b38d225125ec3f0a4ec974c8bcae0ae5358894abd8c118aa1a6b3c9b457e7 +-- hash: bda1ef012fe2084207b76af87373ec5568167d027ce8878be222946dc4a82d5b name: th-utilities -version: 0.2.1.0 +version: 0.2.3.1 synopsis: Collection of useful functions for use with Template Haskell category: Template Haskell homepage: https://github.com/fpco/th-utilities#readme
