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

Geoffrey Mainland gmainlan at microsoft.com
Thu May 16 17:08:43 CEST 2013


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

On branch  : th-new

http://hackage.haskell.org/trac/ghc/changeset/79c6851ca5126532bf3d7605f73e95b9207281bc

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

commit 79c6851ca5126532bf3d7605f73e95b9207281bc
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 a435f66..b1c732f 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 62b1999..6bb2787 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