TH_repPrim.hs 988 Bytes
Newer Older
1
{-# OPTIONS -fglasgow-exts #-}
2 3
-- test the representation of unboxed literals

4
module Main where
5 6 7

import GHC.Base
import GHC.Float
8
import Language.Haskell.TH
9
import Text.PrettyPrint
10
import System.IO
11 12 13

main :: IO ()
main = do putStrLn $ show $ $( do e <- [| I# 20# |]
14 15 16
                                  runIO $ putStrLn $ show e
                                  runIO $ putStrLn $ render $ pprExp e
				  runIO $ hFlush stdout
17 18
                                  return e )
          putStrLn $ show $ $( do e <- [| F# 12.3# |]
19 20 21
                                  runIO $ putStrLn $ show e
                                  runIO $ putStrLn $ render $ pprExp e
				  runIO $ hFlush stdout
22 23
                                  return e )
          putStrLn $ show $ $( do e <- [| D# 24.6## |]
24 25 26
                                  runIO $ putStrLn $ show e
                                  runIO $ putStrLn $ render $ pprExp e
				  runIO $ hFlush stdout
27 28
                                  return e )