summaryrefslogtreecommitdiff
path: root/libraries/base/tests/readFixed001.hs
blob: 5336f9b7b8400e89f363f32e1a9fa0fa4cd195b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13

import Data.Fixed

main :: IO ()
main = do f "  (( (  12.3456  ) )  )  "
          f "  (( (  12.3     ) )  )  "
          f "  (( (  12.      ) )  )  "
          f "  (( (  12       ) )  )  "
          f "  (( - (  12.3456  ) )  )  "
          f "  (( (  -12.3456  ) )  )  "

f :: String -> IO ()
f str = print (reads str :: [(Centi, String)])