[commit: template-haskell] th-new-7.6: Add TExp data type. (e2de3dc)

Geoffrey Mainland gmainlan at microsoft.com
Wed Jun 12 12:04:24 CEST 2013


Repository : ssh://darcs.haskell.org//srv/darcs/packages/template-haskell

On branch  : th-new-7.6

http://hackage.haskell.org/trac/ghc/changeset/e2de3dc34a7ce87b412e7f21c794f4c3a83c8e08

>---------------------------------------------------------------

commit e2de3dc34a7ce87b412e7f21c794f4c3a83c8e08
Author: Geoffrey Mainland <mainland at apeiron.net>
Date:   Wed Apr 24 14:11:04 2013 +0100

    Add TExp data type.

>---------------------------------------------------------------

 Language/Haskell/TH.hs        |    3 +++
 Language/Haskell/TH/Syntax.hs |    8 ++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/Language/Haskell/TH.hs b/Language/Haskell/TH.hs
index 5ec7cf1..29050f7 100644
--- a/Language/Haskell/TH.hs
+++ b/Language/Haskell/TH.hs
@@ -31,6 +31,9 @@ module Language.Haskell.TH(
 	reifyInstances,
 	isInstance,
 
+	-- * 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 9173aff..a1a4ec3 100644
--- a/Language/Haskell/TH/Syntax.hs
+++ b/Language/Haskell/TH/Syntax.hs
@@ -141,6 +141,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