diff options
author | Geoffrey Mainland <mainland@apeiron.net> | 2013-05-21 15:10:35 +0100 |
---|---|---|
committer | Geoffrey Mainland <mainland@apeiron.net> | 2013-10-04 14:58:26 -0400 |
commit | 9caca0a3fe0ad9c38ea5886d4edf4fc8cbf7c567 (patch) | |
tree | 7d8780ed891aa00423d60db3fa9967995f7fbf66 /libraries/template-haskell | |
parent | 4d226b32d86466d67fe857690136a1418897b672 (diff) | |
download | haskell-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.hs | 10 |
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 |