TH_repE1.hs 512 Bytes
Newer Older
1 2 3 4 5
-- test the representation of literals and also explicit type annotations

module TH_repE1
where

6
import Language.Haskell.TH
7

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

intExpr :: ExpQ
12 13
intExpr = [| 42 :: Int |]

14
integerExpr :: ExpQ
15 16
integerExpr = [| 42 :: Integer |]

17
charExpr :: ExpQ
18 19
charExpr = [| 'x' |]

20
stringExpr :: ExpQ
21 22
stringExpr = [| "A String" |]

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

floatExpr :: ExpQ
27 28
floatExpr = [| 1.2 :: Float |]

29
doubleExpr :: ExpQ
30
doubleExpr = [| 1.2 :: Double |]