TH_repE1.hs 518 Bytes
Newer Older
chak's avatar
chak committed
1 2 3 4 5 6 7
-- test the representation of literals and also explicit type annotations

module TH_repE1
where

import Language.Haskell.THSyntax

8 9 10 11
integralExpr :: ExpQ
integralExpr = [| 42 |]

intExpr :: ExpQ
chak's avatar
chak committed
12 13
intExpr = [| 42 :: Int |]

14
integerExpr :: ExpQ
chak's avatar
chak committed
15 16
integerExpr = [| 42 :: Integer |]

17
charExpr :: ExpQ
chak's avatar
chak committed
18 19
charExpr = [| 'x' |]

20
stringExpr :: ExpQ
chak's avatar
chak committed
21 22
stringExpr = [| "A String" |]

23 24 25 26
fractionalExpr :: ExpQ
fractionalExpr = [| 1.2 |]

floatExpr :: ExpQ
chak's avatar
chak committed
27 28
floatExpr = [| 1.2 :: Float |]

29
doubleExpr :: ExpQ
chak's avatar
chak committed
30
doubleExpr = [| 1.2 :: Double |]