[commit: packages/template-haskell] wip/th-new: Add TExp data type. (1176e2b)
git at git.haskell.org
git at git.haskell.org
Mon Sep 23 07:59:20 CEST 2013
Repository : ssh://git@git.haskell.org/template-haskell
On branch : wip/th-new
Link : http://git.haskell.org/packages/template-haskell.git/commitdiff/1176e2ba3994f7ad088e1750b9643245c3cfc5d7
>---------------------------------------------------------------
commit 1176e2ba3994f7ad088e1750b9643245c3cfc5d7
Author: Geoffrey Mainland <mainland at apeiron.net>
Date: Wed Apr 24 14:11:04 2013 +0100
Add TExp data type.
>---------------------------------------------------------------
1176e2ba3994f7ad088e1750b9643245c3cfc5d7
Language/Haskell/TH.hs | 3 +++
Language/Haskell/TH/Syntax.hs | 8 ++++++++
2 files changed, 11 insertions(+)
diff --git a/Language/Haskell/TH.hs b/Language/Haskell/TH.hs
index 38c91fe..a0149d4 100644
--- a/Language/Haskell/TH.hs
+++ b/Language/Haskell/TH.hs
@@ -33,6 +33,9 @@ module Language.Haskell.TH(
-- *** Roles lookup
reifyRoles,
+ -- * Typed expressions
+ TExp, unType,
+
-- * Names
Name, NameSpace, -- Abstract
-- ** Constructing names
diff --git a/Language/Haskell/TH/Syntax.hs b/Language/Haskell/TH/Syntax.hs
index d59ffff..b62b7d9 100644
--- a/Language/Haskell/TH/Syntax.hs
+++ b/Language/Haskell/TH/Syntax.hs
@@ -136,6 +136,14 @@ instance Applicative Q where
pure x = Q (pure x)
Q f <*> Q x = Q (f <*> x)
+-----------------------------------------------------
+--
+-- The TExp type
+--
+-----------------------------------------------------
+
+newtype TExp a = TExp { unType :: Q Exp }
+
----------------------------------------------------
-- Packaged versions for the programmer, hiding the Quasi-ness
More information about the ghc-commits
mailing list