summaryrefslogtreecommitdiff
path: root/tests/examples/ghc86/TH_spliceE3.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/examples/ghc86/TH_spliceE3.hs')
-rw-r--r--tests/examples/ghc86/TH_spliceE3.hs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/examples/ghc86/TH_spliceE3.hs b/tests/examples/ghc86/TH_spliceE3.hs
new file mode 100644
index 0000000..3ec7ef6
--- /dev/null
+++ b/tests/examples/ghc86/TH_spliceE3.hs
@@ -0,0 +1,26 @@
+-- test the representation of literals and also explicit type annotations
+{-# LANGUAGE TemplateHaskell #-}
+
+module TH_repE1
+where
+
+import Language.Haskell.TH
+
+$( do let emptyListExpr :: ExpQ
+ emptyListExpr = [| [] |]
+
+ singletonListExpr :: ExpQ
+ singletonListExpr = [| [4] |]
+
+ listExpr :: ExpQ
+ listExpr = [| [4,5,6] |]
+
+ consExpr :: ExpQ
+ consExpr = [| 4:5:6:[] |]
+
+ [d| foo = ($emptyListExpr, $singletonListExpr, $listExpr, $consExpr) |]
+ )
+
+bar = $( [| case undefined of
+ [1] -> 1 |] )
+