diff options
author | AndresLoeh <> | 2021-02-23 10:33:00 (GMT) |
---|---|---|
committer | hdiff <hdiff@hdiff.luite.com> | 2021-02-23 10:33:00 (GMT) |
commit | ec0eecaa15953c2ddfd6489d3b9f00e91fab5bbf (patch) | |
tree | 83e8601ee1025edacdb3d6b411a556f298ba8c9e | |
parent | 9fc4ce5cfc943f6c439297f0c7efc57681e02624 (diff) |
-rw-r--r--[-rwxr-xr-x] | CHANGELOG.md | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | doctest.sh | 0 | ||||
-rw-r--r-- | generics-sop.cabal | 12 | ||||
-rw-r--r-- | src/Generics/SOP/Instances.hs | 2 | ||||
-rw-r--r-- | src/Generics/SOP/TH.hs | 13 |
5 files changed, 20 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b0a2098..91ca9c7 100755..100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.5.1.1 (2020-xx-yy) + +* Compatibility with GHC-9.0 + # 0.5.1.0 (2020-03-29) * Compatibility with GHC-8.10 (thanks to Ryan Scott). diff --git a/doctest.sh b/doctest.sh index f9f2bf2..f9f2bf2 100755..100644 --- a/doctest.sh +++ b/doctest.sh diff --git a/generics-sop.cabal b/generics-sop.cabal index 89ae916..651b0f9 100644 --- a/generics-sop.cabal +++ b/generics-sop.cabal @@ -1,5 +1,5 @@ name: generics-sop -version: 0.5.1.0 +version: 0.5.1.1 synopsis: Generic Programming using True Sums of Products description: A library to support the definition of generic functions. @@ -42,7 +42,7 @@ category: Generics build-type: Simple cabal-version: >=1.10 extra-source-files: CHANGELOG.md doctest.sh -tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.2, GHC == 8.10.1 +tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.2, GHC == 8.10.4, GHC == 9.0.1 source-repository head type: git @@ -65,11 +65,11 @@ library Generics.SOP.NP Generics.SOP.NS Generics.SOP.Sing - build-depends: base >= 4.9 && < 4.15, + build-depends: base >= 4.9 && < 4.16, sop-core == 0.5.0.*, - template-haskell >= 2.8 && < 2.17, - th-abstraction >= 0.3 && < 0.4, - ghc-prim >= 0.3 && < 0.7 + template-haskell >= 2.8 && < 2.18, + th-abstraction >= 0.4 && < 0.5, + ghc-prim >= 0.3 && < 0.8 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall diff --git a/src/Generics/SOP/Instances.hs b/src/Generics/SOP/Instances.hs index 0476f51..a8fe274 100644 --- a/src/Generics/SOP/Instances.hs +++ b/src/Generics/SOP/Instances.hs @@ -262,7 +262,9 @@ deriveGeneric ''SrcLoc -- new deriveGeneric ''RuntimeRep -- new deriveGeneric ''VecCount -- new deriveGeneric ''VecElem -- new +#if !MIN_VERSION_base(4,15,0) deriveGeneric ''SpecConstrAnnotation -- new +#endif -- From GHC.Generics: deriveGeneric ''GHC.Generics.K1 -- new diff --git a/src/Generics/SOP/TH.hs b/src/Generics/SOP/TH.hs index b80bef3..da2638f 100644 --- a/src/Generics/SOP/TH.hs +++ b/src/Generics/SOP/TH.hs @@ -14,6 +14,9 @@ import Control.Monad (join, replicateM, unless) import Data.List (foldl') import Data.Maybe (fromMaybe) import Data.Proxy + +-- importing in this order to avoid unused import warning +import Language.Haskell.TH.Datatype.TyVarBndr import Language.Haskell.TH import Language.Haskell.TH.Datatype as TH @@ -186,14 +189,14 @@ deriveMetadataType n datatypeInfoName = do [ tySynD datatypeInfoName' [] (metadataType' variant name cons) ] deriveGenericForDataDec :: - (Name -> Q Type) -> DatatypeVariant -> Cxt -> Name -> [TyVarBndr] -> [Type] -> [TH.ConstructorInfo] -> Q [Dec] + (Name -> Q Type) -> DatatypeVariant -> Cxt -> Name -> [TyVarBndrUnit] -> [Type] -> [TH.ConstructorInfo] -> Q [Dec] deriveGenericForDataDec f _variant _cxt name _bndrs instTys cons = do let typ = appTysSubst f name instTys deriveGenericForDataType f typ cons deriveGenericForDataType :: (Name -> Q Type) -> Q Type -> [TH.ConstructorInfo] -> Q [Dec] deriveGenericForDataType f typ cons = do - let codeSyn = tySynInstDCompat ''Code Nothing [typ] (codeFor f cons) + let codeSyn = tySynInstDCompat ''Generics.SOP.Universe.Code Nothing [typ] (codeFor f cons) inst <- instanceD (cxt []) [t| Generic $typ |] @@ -201,7 +204,7 @@ deriveGenericForDataType f typ cons = do return [inst] deriveMetadataForDataDec :: - (Name -> Q Type) -> DatatypeVariant -> Cxt -> Name -> [TyVarBndr] -> [Type] -> [TH.ConstructorInfo] -> Q [Dec] + (Name -> Q Type) -> DatatypeVariant -> Cxt -> Name -> [TyVarBndrUnit] -> [Type] -> [TH.ConstructorInfo] -> Q [Dec] deriveMetadataForDataDec f variant _cxt name _bndrs instTys cons = do let typ = appTysSubst f name instTys deriveMetadataForDataType variant name typ cons @@ -508,7 +511,7 @@ promotedTypeListSubst f (t:ts) = [t| $promotedConsT $(t >>= substType f) $(promo appsT :: Name -> [Q Type] -> Q Type appsT n = foldl' appT (conT n) -appTyVars :: (Name -> Q Type) -> Name -> [TyVarBndr] -> Q Type +appTyVars :: (Name -> Q Type) -> Name -> [TyVarBndrUnit] -> Q Type appTyVars f n bndrs = appsT n (map (f . tvName) bndrs) @@ -545,7 +548,7 @@ withDataDec :: TH.DatatypeInfo -- The datatype context -> Name -- The data type's name - -> [TyVarBndr] + -> [TyVarBndrUnit] -- The datatype's type variable binders, both implicit and explicit. -- Examples: -- |