summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/lib/Data.Fixed/data-fixed-show-read.hs
blob: 349f639f2c8a6812092306ecfb6697c6d2153a92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

module Main (main) where

import Data.Fixed

main :: IO ()
main = do doit 38.001
          doit 38.009
          doit 38.01
          doit 38.09
          print (read "38" :: Centi)
          doit (-38.001)
          doit (-38.009)
          doit (-38.01)
          doit (-38.09)
          print (read "-38" :: Centi)

doit :: Centi -> IO ()
doit c = do let s = show c
                r = read s :: Centi
            putStrLn s
            print r