Hello community, here is the log from the commit of package ghc-th-lift for openSUSE:Factory checked in at 2020-10-23 15:15:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-th-lift (Old) and /work/SRC/openSUSE:Factory/.ghc-th-lift.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-th-lift" Fri Oct 23 15:15:04 2020 rev:13 rq:842769 version:0.8.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-th-lift/ghc-th-lift.changes 2020-08-28 21:39:27.104839597 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-th-lift.new.3463/ghc-th-lift.changes 2020-10-23 15:15:07.934156958 +0200 @@ -1,0 +2,9 @@ +Wed Sep 30 08:36:13 UTC 2020 - psim...@suse.com + +- Update th-lift to version 0.8.2. + ## [0.8.2] - 2020-09-29 + + * Allow building with `template-haskell-2.17.0.0` (GHC 9.0). + * Make `deriveLift` work for unlifted newtypes. + +------------------------------------------------------------------- Old: ---- th-lift-0.8.1.tar.gz New: ---- th-lift-0.8.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-th-lift.spec ++++++ --- /var/tmp/diff_new_pack.VIp1js/_old 2020-10-23 15:15:09.310157622 +0200 +++ /var/tmp/diff_new_pack.VIp1js/_new 2020-10-23 15:15:09.314157624 +0200 @@ -19,7 +19,7 @@ %global pkg_name th-lift %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.8.1 +Version: 0.8.2 Release: 0 Summary: Derive Template Haskell's Lift class for datatypes License: (BSD-3-Clause OR GPL-2.0-only) ++++++ th-lift-0.8.1.tar.gz -> th-lift-0.8.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/th-lift-0.8.1/CHANGELOG.md new/th-lift-0.8.2/CHANGELOG.md --- old/th-lift-0.8.1/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/th-lift-0.8.2/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [0.8.2] - 2020-09-29 + +* Allow building with `template-haskell-2.17.0.0` (GHC 9.0). +* Make `deriveLift` work for unlifted newtypes. + ## [0.8.1] - 2019-12-06 * Support GHC 8.10/`template-haskell-2.16`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/th-lift-0.8.1/src/Language/Haskell/TH/Lift/Internal.hs new/th-lift-0.8.2/src/Language/Haskell/TH/Lift/Internal.hs --- old/th-lift-0.8.1/src/Language/Haskell/TH/Lift/Internal.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/th-lift-0.8.2/src/Language/Haskell/TH/Lift/Internal.hs 2001-09-09 03:46:40.000000000 +0200 @@ -0,0 +1,44 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE ScopedTypeVariables #-} + +#if __GLASGOW_HASKELL__ >= 706 +{-# LANGUAGE PolyKinds #-} +#endif + +-- | Helper functions used in code that "Language.Haskell.TH.Lift" generates. +-- +-- Note: this is an internal module, and as such, the API presented here is not +-- guaranteed to be stable, even between minor releases of this library. +module Language.Haskell.TH.Lift.Internal where + +#if MIN_VERSION_template_haskell(2,16,0) +import GHC.Exts (RuntimeRep, TYPE) +#endif + +import Language.Haskell.TH.Syntax + +-- | A type-restricted version of 'error' that ensures 'makeLift' always +-- returns a value of type @q 'Exp'@ (where @q@ is an instance of 'Quote'), +-- even when used on an empty datatype. +#if MIN_VERSION_template_haskell(2,17,0) +errorQuoteExp :: Quote q => String -> q Exp +#else +errorQuoteExp :: String -> Q Exp +#endif +errorQuoteExp = error + +-- | This is a cargo-culted version of @unsafeSpliceCoerce@ from the +-- @th-compat@ library, which has been copied here to avoid incurring a library +-- dependency. +-- +-- Only available when built with @template-haskell-2.9.0.0@ or later. +#if MIN_VERSION_template_haskell(2,17,0) +unsafeSpliceCoerce :: forall (r :: RuntimeRep) (a :: TYPE r) m. Quote m => m Exp -> Code m a +unsafeSpliceCoerce = unsafeCodeCoerce +#elif MIN_VERSION_template_haskell(2,16,0) +unsafeSpliceCoerce :: forall (r :: RuntimeRep) (a :: TYPE r). Q Exp -> Q (TExp a) +unsafeSpliceCoerce = unsafeTExpCoerce +#elif MIN_VERSION_template_haskell(2,9,0) +unsafeSpliceCoerce :: forall a. Q Exp -> Q (TExp a) +unsafeSpliceCoerce = unsafeTExpCoerce +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/th-lift-0.8.1/src/Language/Haskell/TH/Lift.hs new/th-lift-0.8.2/src/Language/Haskell/TH/Lift.hs --- old/th-lift-0.8.1/src/Language/Haskell/TH/Lift.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/th-lift-0.8.2/src/Language/Haskell/TH/Lift.hs 2001-09-09 03:46:40.000000000 +0200 @@ -34,6 +34,7 @@ import Language.Haskell.TH import Language.Haskell.TH.Datatype import qualified Language.Haskell.TH.Lib as Lib (starK) +import Language.Haskell.TH.Lift.Internal import Language.Haskell.TH.Syntax import Control.Monad ((<=<), zipWithM) #if MIN_VERSION_template_haskell(2,9,0) @@ -140,17 +141,19 @@ #else /* MIN_VERSION_template_haskell(2,9,0) */ let phtys = [] #endif + _x <- newName "x" instanceD (ctxt dcx phtys tys) (conT ''Lift `appT` typ n tys) [ funD 'lift [clause [] (normalB (makeLiftOne n cons)) []] #if MIN_VERSION_template_haskell(2,16,0) - , funD 'liftTyped [clause [] (normalB [| unsafeTExpCoerce . lift |]) []] + , let rhs = varE 'unsafeSpliceCoerce `appE` + (varE 'lift `appE` varE _x) in + funD 'liftTyped [clause [varP _x] (normalB rhs) []] #endif ] typ n = foldl appT (conT n) . map unKind - -- Only consider *-kinded type variables, because Lift instances cannot - -- meaningfully be given to types of other kinds. Further, filter out type - -- variables that are obviously phantom. + -- Only consider *-kinded type variables for now. Furthermore, filter out + -- type variables that are obviously phantom. ctxt dcx phtys = fmap (dcx ++) . cxt . concatMap liftPred . filter (`notElem` phtys) liftPred ty = @@ -176,7 +179,8 @@ consMatches :: Name -> [ConstructorInfo] -> [Q Match] consMatches n [] = [match wildP (normalB e) []] where - e = varE 'errorQExp `appE` (stringE $ "Can't lift value of empty datatype " ++ nameBase n) + e = varE 'errorQuoteExp `appE` + (stringE $ "Can't lift value of empty datatype " ++ nameBase n) consMatches _ cons = concatMap doCons cons doCons :: ConstructorInfo -> [Q Match] @@ -247,34 +251,28 @@ } -> f dcx n vs cons --- A type-restricted version of error that ensures makeLift always returns a --- value of type Q Exp, even when used on an empty datatype. -errorQExp :: String -> Q Exp -errorQExp = error -{-# INLINE errorQExp #-} - instance Lift Name where lift (Name occName nameFlavour) = [| Name occName nameFlavour |] #if MIN_VERSION_template_haskell(2,16,0) - liftTyped = unsafeTExpCoerce . lift + liftTyped = unsafeSpliceCoerce . lift #endif instance Lift OccName where lift n = [| mkOccName |] `appE` lift (occString n) #if MIN_VERSION_template_haskell(2,16,0) - liftTyped = unsafeTExpCoerce . lift + liftTyped = unsafeSpliceCoerce . lift #endif instance Lift PkgName where lift n = [| mkPkgName |] `appE` lift (pkgString n) #if MIN_VERSION_template_haskell(2,16,0) - liftTyped = unsafeTExpCoerce . lift + liftTyped = unsafeSpliceCoerce . lift #endif instance Lift ModName where lift n = [| mkModName |] `appE` lift (modString n) #if MIN_VERSION_template_haskell(2,16,0) - liftTyped = unsafeTExpCoerce . lift + liftTyped = unsafeSpliceCoerce . lift #endif instance Lift NameFlavour where @@ -292,7 +290,7 @@ lift (NameG nameSpace' pkgName modnam) = [| NameG nameSpace' pkgName modnam |] #if MIN_VERSION_template_haskell(2,16,0) - liftTyped = unsafeTExpCoerce . lift + liftTyped = unsafeSpliceCoerce . lift #endif instance Lift NameSpace where @@ -300,5 +298,5 @@ lift DataName = [| DataName |] lift TcClsName = [| TcClsName |] #if MIN_VERSION_template_haskell(2,16,0) - liftTyped = unsafeTExpCoerce . lift + liftTyped = unsafeSpliceCoerce . lift #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/th-lift-0.8.1/t/Foo.hs new/th-lift-0.8.2/t/Foo.hs --- old/th-lift-0.8.1/t/Foo.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/th-lift-0.8.2/t/Foo.hs 2001-09-09 03:46:40.000000000 +0200 @@ -7,6 +7,10 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} + +#if __GLASGOW_HASKELL__ >= 810 +{-# LANGUAGE UnliftedNewtypes #-} +#endif module Foo where import GHC.Prim (Double#, Float#, Int#, Word#) @@ -16,7 +20,7 @@ import Language.Haskell.TH.Lift #if MIN_VERSION_template_haskell(2,16,0) -import Language.Haskell.TH.Syntax (unsafeTExpCoerce) +import Language.Haskell.TH.Lift.Internal (unsafeSpliceCoerce) #endif -- Phantom type parameters can't be dealt with poperly on GHC < 7.8. @@ -65,7 +69,7 @@ instance Lift (f (Fix f)) => Lift (Fix f) where lift = $(makeLift ''Fix) #if MIN_VERSION_template_haskell(2,16,0) - liftTyped = unsafeTExpCoerce . lift + liftTyped = unsafeSpliceCoerce . lift #endif #if MIN_VERSION_template_haskell(2,7,0) @@ -73,7 +77,7 @@ instance (Eq a, Lift a) => Lift (Fam a Bool Bool) where lift = $(makeLift 'FamInstBool) #if MIN_VERSION_template_haskell(2,16,0) - liftTyped = unsafeTExpCoerce . lift + liftTyped = unsafeSpliceCoerce . lift #endif #endif @@ -97,9 +101,15 @@ $(pure []) instance Lift (f (Fix2 f)) => Lift (Fix2 f) where - liftTyped = unsafeTExpCoerce . $(makeLift ''Fix2) + liftTyped = unsafeSpliceCoerce . $(makeLift ''Fix2) instance Lift a => Lift (Fam2 a Int Char) where - liftTyped = unsafeTExpCoerce . $(makeLift 'Fam2Prefix1) + liftTyped = unsafeSpliceCoerce . $(makeLift 'Fam2Prefix1) instance (Eq a, Lift a) => Lift (Fam2 a Bool Bool) where - liftTyped = unsafeTExpCoerce . $(makeLift 'Fam2InstBool) + liftTyped = unsafeSpliceCoerce . $(makeLift 'Fam2InstBool) +#endif + +#if __GLASGOW_HASKELL__ >= 810 +-- Regression test for #43 +newtype T43 = MkT43 Int# +$(deriveLift ''T43) #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/th-lift-0.8.1/th-lift.cabal new/th-lift-0.8.2/th-lift.cabal --- old/th-lift-0.8.1/th-lift.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/th-lift-0.8.2/th-lift.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ Name: th-lift -Version: 0.8.1 +Version: 0.8.2 Cabal-Version: 1.12 License: BSD3 License-Files: COPYING, BSD3, GPL-2 @@ -26,7 +26,7 @@ old versions of their respective libraries, as the same @Lift@ instances are also present upstream on newer versions. Category: Language -Tested-With: GHC==7.0.4, GHC==7.2.2, GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.4, GHC==8.6.5, GHC==8.8.1, GHC==8.10.1 +Tested-With: GHC==7.0.4, GHC==7.2.2, GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.4, GHC==8.6.5, GHC==8.8.3, GHC==8.10.1 build-type: Simple Extra-source-files: CHANGELOG.md @@ -37,6 +37,7 @@ Library Default-Language: Haskell2010 Exposed-modules: Language.Haskell.TH.Lift + Language.Haskell.TH.Lift.Internal Other-Extensions: CPP, MagicHash, TypeSynonymInstances, FlexibleInstances if impl(ghc >= 8.0) Other-Extensions: TemplateHaskellQuotes @@ -45,8 +46,8 @@ Hs-Source-Dirs: src Build-Depends: base >= 4.3 && < 5, ghc-prim, - th-abstraction >= 0.2.3 && < 0.4, - template-haskell >= 2.5 && < 2.17 + th-abstraction >= 0.2.3 && < 0.5, + template-haskell >= 2.5 && < 2.18 ghc-options: -Wall Test-Suite test