File fix-ghc8-build.patch of Package ghc-applicative-quoters
From 57efed7b61fa948c33de69a170635ce90642a287 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Baldur=20Bl=C3=B6ndal?= <baldurpet@gmail.com>
Date: Thu, 4 Aug 2016 15:17:39 +0000
Subject: [PATCH] Fixed according to
https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0
---
Control/Applicative/QQ/ADo.hs | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/Control/Applicative/QQ/ADo.hs b/Control/Applicative/QQ/ADo.hs
index f912a0b..deb22ee 100644
--- a/Control/Applicative/QQ/ADo.hs
+++ b/Control/Applicative/QQ/ADo.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE CPP, TemplateHaskell #-}
-- | Applicative do. Philippa Cowderoy's idea, some explanations due Edward
-- Kmett
@@ -161,13 +161,25 @@ singleCon :: Name -> Q Bool
singleCon n = do
dec <- recover noScope $ do
Just vn <- lookupValueName (show n)
+# if MIN_VERSION_template_haskell(2,11,0)
+ DataConI _ _ tn <- reify vn
+# else
DataConI _ _ tn _ <- reify vn
+# endif
TyConI dec <- reify tn
return dec
case dec of
+#if MIN_VERSION_template_haskell(2,11,0)
+ DataD _ _ _ _ [_] _ -> return True
+# else
DataD _ _ _ [_] _ -> return True
+#endif
NewtypeD {} -> return True
+#if MIN_VERSION_template_haskell(2,11,0)
+ DataD _ _ _ _ (_:_) _ -> return False
+# else
DataD _ _ _ (_:_) _ -> return False
+#endif
_ -> fail $ "ado singleCon: not a data declaration: " ++ show dec
where
noScope = fail $ "Data constructor " ++ show n ++ " lookup failed."