add GHC.HetMet.{hetmet_kappa,hetmet_kappa_app}
[ghc-base.git] / tests / fixed.hs
1 {-# OPTIONS_GHC -Wall -Werror #-}
2
3 module Main where
4
5 import Data.Fixed
6
7 nums :: Fractional a => [a]
8 nums = [0,7,7.1,7.01,7.9,7.09,5 + 7,3.2 - 7.8,5.75 * (-2)]
9
10 main :: IO ()
11 main = do mapM_ putStrLn $ doit (nums :: [Micro])
12           mapM_ putStrLn $ doit (nums :: [Pico])
13
14 doit :: HasResolution a => [Fixed a] -> [String]
15 doit xs = [ showFun (signFun x)
16           | showFun <- [show, showFixed True]
17           , signFun <- [id, negate]
18           , x <- xs ]
19