summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorryanglscott <>2018-09-14 00:16:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-09-14 00:16:00 (GMT)
commit7d211827a4e418b8d6902b5ce5732072fb708d70 (patch)
treeadfa0892ff72f0f4ccc862c35572289d7014ea12
parent655d38b1386cac302efee12e0b59398026315c04 (diff)
version 0.5.2HEAD0.5.2master
-rw-r--r--CHANGELOG.md4
-rw-r--r--deriving-compat.cabal2
-rw-r--r--src/Data/Deriving/Via/Internal.hs5
3 files changed, 10 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d5a9382..b50a066 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+### 0.5.2 [2018.09.13]
+* Fix a bug (on GHC 8.7 and above) in which `deriveGND`/`deriveVia` would
+ generate ill-scoped code.
+
### 0.5.1 [2018.07.11]
* Have `deriveGND`/`deriveVia` throw an error if an incorrect number of
arguments are supplied to the type class.
diff --git a/deriving-compat.cabal b/deriving-compat.cabal
index 889edea..e11edd5 100644
--- a/deriving-compat.cabal
+++ b/deriving-compat.cabal
@@ -1,5 +1,5 @@
name: deriving-compat
-version: 0.5.1
+version: 0.5.2
synopsis: Backports of GHC deriving extensions
description: Provides Template Haskell functions that mimic deriving
extensions that were introduced or modified in recent versions
diff --git a/src/Data/Deriving/Via/Internal.hs b/src/Data/Deriving/Via/Internal.hs
index 2728c51..26d396a 100644
--- a/src/Data/Deriving/Via/Internal.hs
+++ b/src/Data/Deriving/Via/Internal.hs
@@ -184,7 +184,12 @@ changeLast [_] x = [x]
changeLast (x:xs) x' = x : changeLast xs x'
stripOuterForallT :: Type -> Type
+#if __GLASGOW_HASKELL__ < 807
+-- Before GHC 8.7, TH-reified classes would put a redundant forall/class
+-- context in front of each method's type signature, so we have to strip them
+-- off here.
stripOuterForallT (ForallT _ _ ty) = ty
+#endif
stripOuterForallT ty = ty
decomposeType :: Type -> (Cxt, Type)