generic-deriving 1.14.2 → 1.14.3
raw patch · 5 files changed
+36/−13 lines, 5 filesdep ~template-haskelldep ~th-abstractionPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: template-haskell, th-abstraction
API changes (from Hackage documentation)
- Generics.Deriving.Enum: instance Generics.Deriving.Enum.GEnum GHC.Integer.Type.Integer
- Generics.Deriving.Enum: instance Generics.Deriving.Enum.GEnum GHC.Natural.Natural
- Generics.Deriving.Enum: instance Generics.Deriving.Enum.GIx GHC.Integer.Type.Integer
- Generics.Deriving.Enum: instance Generics.Deriving.Enum.GIx GHC.Natural.Natural
- Generics.Deriving.Eq: instance Generics.Deriving.Eq.GEq GHC.Integer.Type.Integer
- Generics.Deriving.Eq: instance Generics.Deriving.Eq.GEq GHC.Natural.Natural
- Generics.Deriving.Instances: instance GHC.Generics.Generic (a, b, c, d, e, f, g, h)
- Generics.Deriving.Instances: instance GHC.Generics.Generic (a, b, c, d, e, f, g, h, i)
- Generics.Deriving.Instances: instance GHC.Generics.Generic (a, b, c, d, e, f, g, h, i, j)
- Generics.Deriving.Instances: instance GHC.Generics.Generic (a, b, c, d, e, f, g, h, i, j, k)
- Generics.Deriving.Instances: instance GHC.Generics.Generic (a, b, c, d, e, f, g, h, i, j, k, l)
- Generics.Deriving.Instances: instance GHC.Generics.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m)
- Generics.Deriving.Instances: instance GHC.Generics.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
- Generics.Deriving.Instances: instance GHC.Generics.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
- Generics.Deriving.Instances: instance GHC.Generics.Generic1 ((,,,,,,,) a b c d e f g)
- Generics.Deriving.Instances: instance GHC.Generics.Generic1 ((,,,,,,,,) a b c d e f g h)
- Generics.Deriving.Instances: instance GHC.Generics.Generic1 ((,,,,,,,,,) a b c d e f g h i)
- Generics.Deriving.Instances: instance GHC.Generics.Generic1 ((,,,,,,,,,,) a b c d e f g h i j)
- Generics.Deriving.Instances: instance GHC.Generics.Generic1 ((,,,,,,,,,,,) a b c d e f g h i j k)
- Generics.Deriving.Instances: instance GHC.Generics.Generic1 ((,,,,,,,,,,,,) a b c d e f g h i j k l)
- Generics.Deriving.Instances: instance GHC.Generics.Generic1 ((,,,,,,,,,,,,,) a b c d e f g h i j k l m)
- Generics.Deriving.Instances: instance GHC.Generics.Generic1 ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m n)
- Generics.Deriving.Instances: type Rep0Tuple10 a b c d e f g h i j = Rep (a, b, c, d, e, f, g, h, i, j)
- Generics.Deriving.Instances: type Rep0Tuple11 a b c d e f g h i j k = Rep (a, b, c, d, e, f, g, h, i, j, k)
- Generics.Deriving.Instances: type Rep0Tuple12 a b c d e f g h i j k l = Rep (a, b, c, d, e, f, g, h, i, j, k, l)
- Generics.Deriving.Instances: type Rep0Tuple13 a b c d e f g h i j k l m = Rep (a, b, c, d, e, f, g, h, i, j, k, l, m)
- Generics.Deriving.Instances: type Rep0Tuple14 a b c d e f g h i j k l m n = Rep (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
- Generics.Deriving.Instances: type Rep0Tuple15 a b c d e f g h i j k l m n o = Rep (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
- Generics.Deriving.Instances: type Rep0Tuple8 a b c d e f g h = Rep (a, b, c, d, e, f, g, h)
- Generics.Deriving.Instances: type Rep0Tuple9 a b c d e f g h i = Rep (a, b, c, d, e, f, g, h, i)
- Generics.Deriving.Instances: type Rep1Tuple10 a b c d e f g h i = Rep1 ((,,,,,,,,,) a b c d e f g h i)
- Generics.Deriving.Instances: type Rep1Tuple11 a b c d e f g h i j = Rep1 ((,,,,,,,,,,) a b c d e f g h i j)
- Generics.Deriving.Instances: type Rep1Tuple12 a b c d e f g h i j k = Rep1 ((,,,,,,,,,,,) a b c d e f g h i j k)
- Generics.Deriving.Instances: type Rep1Tuple13 a b c d e f g h i j k l = Rep1 ((,,,,,,,,,,,,) a b c d e f g h i j k l)
- Generics.Deriving.Instances: type Rep1Tuple14 a b c d e f g h i j k l m = Rep1 ((,,,,,,,,,,,,,) a b c d e f g h i j k l m)
- Generics.Deriving.Instances: type Rep1Tuple15 a b c d e f g h i j k l m n = Rep1 ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m n)
- Generics.Deriving.Instances: type Rep1Tuple8 a b c d e f g = Rep1 ((,,,,,,,) a b c d e f g)
- Generics.Deriving.Instances: type Rep1Tuple9 a b c d e f g h = Rep1 ((,,,,,,,,) a b c d e f g h)
- Generics.Deriving.Show: instance Generics.Deriving.Show.GShow GHC.Integer.Type.Integer
- Generics.Deriving.Show: instance Generics.Deriving.Show.GShow GHC.Natural.Natural
+ Generics.Deriving.Enum: instance Generics.Deriving.Enum.GEnum GHC.Num.Integer.Integer
+ Generics.Deriving.Enum: instance Generics.Deriving.Enum.GEnum GHC.Num.Natural.Natural
+ Generics.Deriving.Enum: instance Generics.Deriving.Enum.GIx GHC.Num.Integer.Integer
+ Generics.Deriving.Enum: instance Generics.Deriving.Enum.GIx GHC.Num.Natural.Natural
+ Generics.Deriving.Eq: instance Generics.Deriving.Eq.GEq GHC.Num.Integer.Integer
+ Generics.Deriving.Eq: instance Generics.Deriving.Eq.GEq GHC.Num.Natural.Natural
+ Generics.Deriving.Show: instance Generics.Deriving.Show.GShow GHC.Num.Integer.Integer
+ Generics.Deriving.Show: instance Generics.Deriving.Show.GShow GHC.Num.Natural.Natural
Files
- CHANGELOG.md +3/−0
- generic-deriving.cabal +4/−4
- src/Generics/Deriving/TH/Internal.hs +21/−9
- tests/T82Spec.hs +4/−0
- tests/TypeInTypeSpec.hs +4/−0
CHANGELOG.md view
@@ -1,3 +1,6 @@+# 1.14.3 [2023.02.27]+* Support `th-abstraction-0.5.*`.+ # 1.14.2 [2022.07.23] * Fix a bug in which `deriveAll1` could generate ill kinded code when using `kindSigOptions=False`, or when using GHC 8.0 or earlier.
generic-deriving.cabal view
@@ -1,5 +1,5 @@ name: generic-deriving-version: 1.14.2+version: 1.14.3 synopsis: Generic programming library for generalised deriving. description: @@ -129,8 +129,8 @@ build-depends: containers >= 0.1 && < 0.7 , ghc-prim < 1- , template-haskell >= 2.4 && < 2.20- , th-abstraction >= 0.4 && < 0.5+ , template-haskell >= 2.4 && < 2.21+ , th-abstraction >= 0.4 && < 0.6 default-language: Haskell2010 ghc-options: -Wall@@ -148,7 +148,7 @@ build-depends: base >= 4.3 && < 5 , generic-deriving , hspec >= 2 && < 3- , template-haskell >= 2.4 && < 2.20+ , template-haskell >= 2.4 && < 2.21 build-tool-depends: hspec-discover:hspec-discover hs-source-dirs: tests default-language: Haskell2010
src/Generics/Deriving/TH/Internal.hs view
@@ -26,7 +26,7 @@ import qualified Data.Set as Set import Data.Set (Set) -import Language.Haskell.TH.Datatype+import Language.Haskell.TH.Datatype as Datatype import Language.Haskell.TH.Datatype.TyVarBndr import Language.Haskell.TH.Lib import Language.Haskell.TH.Ppr (pprint)@@ -510,6 +510,15 @@ . showString " to an unsaturated type family" $ "" +-- | We cannot define implementations for @from(1)@ or @to(1)@ 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"+ $ ""+ -- | Cannot have a constructor argument of form (forall a1 ... an. <type>) -- when deriving Generic(1) rankNError :: Q a@@ -534,14 +543,17 @@ , datatypeVariant = variant , datatypeCons = cons } <- reifyDatatype name- let variant_ = case variant of- Datatype -> Datatype_- Newtype -> Newtype_- -- This isn't total, but the API requires that the data- -- family instance have at least one constructor anyways,- -- so this will always succeed.- DataInstance -> DataInstance_ $ head cons- NewtypeInstance -> NewtypeInstance_ $ head cons+ variant_ <- case variant of+ Datatype -> return Datatype_+ Newtype -> return Newtype_+ -- This isn't total, but the API requires that the data+ -- family instance have at least one constructor anyways,+ -- so this will always succeed.+ DataInstance -> return $ DataInstance_ $ head cons+ NewtypeInstance -> return $ NewtypeInstance_ $ head cons+#if MIN_VERSION_th_abstraction(0,5,0)+ Datatype.TypeData -> typeDataError parentName+#endif checkDataContext parentName ctxt $ Right (parentName, tys, cons, variant_) where ns :: String
tests/T82Spec.hs view
@@ -3,7 +3,11 @@ {-# LANGUAGE TypeFamilies #-} #if __GLASGOW_HASKELL__ >= 800+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE PolyKinds #-}+# if __GLASGOW_HASKELL__ < 806 {-# LANGUAGE TypeInType #-}+# endif #endif module T82Spec (main, spec) where
tests/TypeInTypeSpec.hs view
@@ -4,7 +4,11 @@ {-# LANGUAGE TypeFamilies #-} #if __GLASGOW_HASKELL__ >= 800+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE PolyKinds #-}+# if __GLASGOW_HASKELL__ < 806 {-# LANGUAGE TypeInType #-}+# endif #endif module TypeInTypeSpec (main, spec) where