diff options
Diffstat (limited to 'testsuite/tests/th/TH_spliceE3.hs')
-rw-r--r-- | testsuite/tests/th/TH_spliceE3.hs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/th/TH_spliceE3.hs b/testsuite/tests/th/TH_spliceE3.hs new file mode 100644 index 0000000000..c72ab79b50 --- /dev/null +++ b/testsuite/tests/th/TH_spliceE3.hs @@ -0,0 +1,25 @@ +-- test the representation of literals and also explicit type annotations + +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 |] ) + |