1 -- Exercising the showing of positive numbers at various bases.
3 module Main(main) where
9 --showDec :: Integral a => a -> ShowS
13 --showBinary :: Integral a => a -> ShowS
16 showIntAtBase 2 (toChr) n r
17 where toChr d = chr (ord '0' + fromIntegral d)
22 print (map (\ x -> showOct x []) [1..32])
23 print (map (\ x -> showDec x []) [1..32])
24 print (map (\ x -> showHex x []) [1..32])
25 -- print (map (\ x -> showBinary x []) [1..32])
26 putStrLn (showOct (241324784::Int) [])
27 putStrLn (showDec (241324784::Int) [])
28 putStrLn (showHex (241324784::Int) [])
29 --- putStrLn (showBinary (241324784::Int) [])