th-lift 0.8.2 → 0.8.3
raw patch · 3 files changed
+31/−11 lines, 3 filesdep ~template-haskelldep ~th-abstraction
Dependency ranges changed: template-haskell, th-abstraction
Files
- CHANGELOG.md +5/−0
- src/Language/Haskell/TH/Lift.hs +19/−6
- th-lift.cabal +7/−5
CHANGELOG.md view
@@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [0.8.3] - 2023.02.27++* Support building with `th-abstraction-0.5.*`.+* Require `th-abstraction-0.3.0.0` or later.+ ## [0.8.2] - 2020-09-29 * Allow building with `template-haskell-2.17.0.0` (GHC 9.0).
src/Language/Haskell/TH/Lift.hs view
@@ -32,7 +32,7 @@ import Data.Char (ord) #endif /* !(MIN_VERSION_template_haskell(2,8,0)) */ import Language.Haskell.TH-import Language.Haskell.TH.Datatype+import Language.Haskell.TH.Datatype as Datatype import qualified Language.Haskell.TH.Lib as Lib (starK) import Language.Haskell.TH.Lift.Internal import Language.Haskell.TH.Syntax@@ -242,14 +242,27 @@ withInfo i f = case i of DatatypeInfo { datatypeContext = dcx , datatypeName = n-#if MIN_VERSION_th_abstraction(0,3,0) , datatypeInstTypes = vs-#else- , datatypeVars = vs-#endif , datatypeCons = cons- } ->+ , datatypeVariant = variant+ } -> do+ case variant of+#if MIN_VERSION_th_abstraction(0,5,0)+ Datatype.TypeData -> typeDataError n+#endif+ _ -> return () f dcx n vs cons++#if MIN_VERSION_th_abstraction(0,5,0)+-- | We cannot define implementations for @lift@ at the term level for+-- @type data@ declarations, which only exist at the type level.+typeDataError :: Name -> Q a+typeDataError dataName = fail+ . showString "Cannot derive instance for ‘"+ . showString (nameBase dataName)+ . showString "‘, which is a ‘type data‘ declaration"+ $ ""+#endif instance Lift Name where lift (Name occName nameFlavour) = [| Name occName nameFlavour |]
th-lift.cabal view
@@ -1,5 +1,5 @@ Name: th-lift-Version: 0.8.2+Version: 0.8.3 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.3, 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.4, GHC==8.10.7, GHC==9.0.2, GHC==9.2.6, GHC==9.4.4, GHC==9.6.1 build-type: Simple Extra-source-files: CHANGELOG.md @@ -44,10 +44,10 @@ else Other-Extensions: TemplateHaskell Hs-Source-Dirs: src- Build-Depends: base >= 4.3 && < 5,+ Build-Depends: base >= 4.3 && < 5, ghc-prim,- th-abstraction >= 0.2.3 && < 0.5,- template-haskell >= 2.5 && < 2.18+ th-abstraction >= 0.3 && < 0.6,+ template-haskell >= 2.5 && < 2.21 ghc-options: -Wall Test-Suite test@@ -57,6 +57,8 @@ Hs-Source-Dirs: t other-modules: Foo ghc-options: -Wall+ if impl(ghc >= 9.0)+ ghc-options: -fenable-th-splice-warnings Build-Depends: base, ghc-prim, th-lift,