summaryrefslogtreecommitdiff
path: root/tests/examples/ghc86/TH_spliceDecl2.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/examples/ghc86/TH_spliceDecl2.hs')
-rw-r--r--tests/examples/ghc86/TH_spliceDecl2.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/examples/ghc86/TH_spliceDecl2.hs b/tests/examples/ghc86/TH_spliceDecl2.hs
new file mode 100644
index 0000000..c5c986d
--- /dev/null
+++ b/tests/examples/ghc86/TH_spliceDecl2.hs
@@ -0,0 +1,13 @@
+-- test splicing of quoted data and newtype declarations
+{-# LANGUAGE TemplateHaskell #-}
+
+module TH_spliceDecl2
+where
+
+import Language.Haskell.TH
+
+-- splice a simple quoted declaration (x 2)
+$([d| data T1 = C1 |])
+
+$([d| newtype T2 = C2 String |])
+