Skip to content
Snippets Groups Projects
Commit f30794c5 authored by Ryan Scott's avatar Ryan Scott
Browse files

Adapt to overloaded TH quotations in GHC HEAD

This patches `shakespeare` and `th-utilities` to adapt to
ghc@9129210f landing in HEAD.
Note that since the `template-haskell` version number hasn't been
bumped yet (see ghc#17645), I had to use
`__GLASGOW_HASKELL__ >= 811` instead of the slightly more precise
`MIN_template_haskell(2,17,0)`.
parent f8df7e37
No related branches found
No related tags found
1 merge request!70Adapt to overloaded TH quotations in GHC HEAD
......@@ -34,7 +34,7 @@ index c8e4e78..8d56a3f 100644
toExp = c
where
diff --git a/Text/Internal/Css.hs b/Text/Internal/Css.hs
index a76e4a5..758b4de 100644
index a76e4a5..6b501c4 100644
--- a/Text/Internal/Css.hs
+++ b/Text/Internal/Css.hs
@@ -1,6 +1,7 @@
......@@ -67,6 +67,18 @@ index a76e4a5..758b4de 100644
where
c :: VarType -> Q Exp
c VTPlain = [|CDPlain . toCss|]
@@ -512,7 +517,11 @@ instance Lift (Attr Unresolved) where
instance Lift (Attr Resolved) where
lift (Attr k v) = [|Attr $(liftBuilder k) $(liftBuilder v) :: Attr Resolved |]
+#if __GLASGOW_HASKELL__ >= 811
+liftBuilder :: Quote m => Builder -> m Exp
+#else
liftBuilder :: Builder -> Q Exp
+#endif
liftBuilder b = [|fromText $ pack $(lift $ TL.unpack $ toLazyText b)|]
instance Lift Content where
diff --git a/Text/Lucius.hs b/Text/Lucius.hs
index f814263..83d4e6a 100644
--- a/Text/Lucius.hs
......
......@@ -12,3 +12,22 @@ index 70b929e..78509ce 100644
import Language.Haskell.TH.Instances ()
import TH.Utilities
diff --git a/src/TH/Utilities.hs b/src/TH/Utilities.hs
index e3b028c..6824e0e 100644
--- a/src/TH/Utilities.hs
+++ b/src/TH/Utilities.hs
@@ -152,7 +152,13 @@ typeRepToType tr = do
-- Without 'ExpLifter', 'lift' tends to just generate code involving
-- data construction. With 'ExpLifter', you can put more complicated
-- expression into this construction.
-data ExpLifter = ExpLifter ExpQ deriving (Typeable)
+data ExpLifter = ExpLifter
+#if __GLASGOW_HASKELL__ >= 811
+ (forall m. Quote m => m Exp)
+#else
+ ExpQ
+#endif
+ deriving (Typeable)
instance Lift ExpLifter where
lift (ExpLifter e) = e
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment