summaryrefslogtreecommitdiff
path: root/tests/examples/ghc86/TH_repE1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/examples/ghc86/TH_repE1.hs')
-rw-r--r--tests/examples/ghc86/TH_repE1.hs32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/examples/ghc86/TH_repE1.hs b/tests/examples/ghc86/TH_repE1.hs
new file mode 100644
index 0000000..d764871
--- /dev/null
+++ b/tests/examples/ghc86/TH_repE1.hs
@@ -0,0 +1,32 @@
+-- test the representation of literals and also explicit type annotations
+{-# LANGUAGE TemplateHaskell #-}
+
+module TH_repE1
+where
+
+import Language.Haskell.TH
+
+integralExpr :: ExpQ
+integralExpr = [| 42 |]
+
+intExpr :: ExpQ
+intExpr = [| 42 :: Int |]
+
+integerExpr :: ExpQ
+integerExpr = [| 42 :: Integer |]
+
+charExpr :: ExpQ
+charExpr = [| 'x' |]
+
+stringExpr :: ExpQ
+stringExpr = [| "A String" |]
+
+fractionalExpr :: ExpQ
+fractionalExpr = [| 1.2 |]
+
+floatExpr :: ExpQ
+floatExpr = [| 1.2 :: Float |]
+
+doubleExpr :: ExpQ
+doubleExpr = [| 1.2 :: Double |]
+