Add explicit `{-# LANGUAGE CPP, PackageImports #-}` pragmas
[packages/haskell2010.git] / Numeric.hs
1 {-# LANGUAGE CPP, PackageImports #-}
2 #if __GLASGOW_HASKELL__ >= 701
3 {-# LANGUAGE Safe #-}
4 #endif
5
6 module Numeric (
7
8 -- * Showing
9
10 showSigned, -- :: (Real a) => (a -> ShowS) -> Int -> a -> ShowS
11
12 showIntAtBase, -- :: Integral a => a -> (a -> Char) -> a -> ShowS
13 showInt, -- :: Integral a => a -> ShowS
14 showHex, -- :: Integral a => a -> ShowS
15 showOct, -- :: Integral a => a -> ShowS
16
17 showEFloat, -- :: (RealFloat a) => Maybe Int -> a -> ShowS
18 showFFloat, -- :: (RealFloat a) => Maybe Int -> a -> ShowS
19 showGFloat, -- :: (RealFloat a) => Maybe Int -> a -> ShowS
20 showFloat, -- :: (RealFloat a) => a -> ShowS
21
22 floatToDigits, -- :: (RealFloat a) => Integer -> a -> ([Int], Int)
23
24 -- * Reading
25
26 -- | /NB:/ 'readInt' is the \'dual\' of 'showIntAtBase',
27 -- and 'readDec' is the \`dual\' of 'showInt'.
28 -- The inconsistent naming is a historical accident.
29
30 readSigned, -- :: (Real a) => ReadS a -> ReadS a
31
32 readInt, -- :: (Integral a) => a -> (Char -> Bool)
33 -- -> (Char -> Int) -> ReadS a
34 readDec, -- :: (Integral a) => ReadS a
35 readOct, -- :: (Integral a) => ReadS a
36 readHex, -- :: (Integral a) => ReadS a
37
38 readFloat, -- :: (RealFloat a) => ReadS a
39
40 lexDigits, -- :: ReadS String
41
42 -- * Miscellaneous
43
44 fromRat, -- :: (RealFloat a) => Rational -> a
45
46 ) where
47
48 import "base" Numeric