summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/TH_NestedSplices_Lib.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/th/TH_NestedSplices_Lib.hs')
-rw-r--r--testsuite/tests/th/TH_NestedSplices_Lib.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/th/TH_NestedSplices_Lib.hs b/testsuite/tests/th/TH_NestedSplices_Lib.hs
new file mode 100644
index 0000000000..91d6173b91
--- /dev/null
+++ b/testsuite/tests/th/TH_NestedSplices_Lib.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE TemplateHaskell #-}
+module TH_NestedSplices_Lib where
+
+import Language.Haskell.TH
+
+spliceExpr :: String -> Q Exp -> Q Exp
+spliceExpr s e = [| (s, $e) |]
+
+declareFun :: String -> Q [Dec]
+declareFun s
+ = do { n <- newName s
+ ; d <- funD n [clause [] (normalB [| 22 |]) []]
+ ; return [d] }
+