summaryrefslogtreecommitdiff
path: root/libraries/template-haskell
diff options
context:
space:
mode:
authorGeoffrey Mainland <mainland@apeiron.net>2013-05-21 15:10:35 +0100
committerGeoffrey Mainland <mainland@apeiron.net>2013-10-04 14:58:26 -0400
commit9caca0a3fe0ad9c38ea5886d4edf4fc8cbf7c567 (patch)
tree7d8780ed891aa00423d60db3fa9967995f7fbf66 /libraries/template-haskell
parent4d226b32d86466d67fe857690136a1418897b672 (diff)
downloadhaskell-9caca0a3fe0ad9c38ea5886d4edf4fc8cbf7c567.tar.gz
Make a TExp a wrap a TH.Exp instead of a TH.ExpQ.
We also provide two new helper functions: unTypeQ :: Q (TExp a) -> Q Exp unsafeTExpCoerce :: Q Exp -> Q (TExp a)
Diffstat (limited to 'libraries/template-haskell')
-rw-r--r--libraries/template-haskell/Language/Haskell/TH/Syntax.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
index 899183eb37..79e29448bb 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
@@ -145,7 +145,15 @@ instance Applicative Q where
--
-----------------------------------------------------
-newtype TExp a = TExp { unType :: Q Exp }
+newtype TExp a = TExp { unType :: Exp }
+
+unTypeQ :: Q (TExp a) -> Q Exp
+unTypeQ m = do { TExp e <- m
+ ; return e }
+
+unsafeTExpCoerce :: Q Exp -> Q (TExp a)
+unsafeTExpCoerce m = do { e <- m
+ ; return (TExp e) }
----------------------------------------------------
-- Packaged versions for the programmer, hiding the Quasi-ness