a002888ab19820bfc691c9cfce93b40cd244aaee
[ghc-hetmet.git] / ghc / lib / std / Ratio.lhs
1 %
2 % (c) The AQUA Project, Glasgow University, 1994-1999
3 %
4
5 \section[Ratio]{Module @Ratio@}
6
7 Standard functions on rational numbers
8
9 \begin{code}
10 {-# OPTIONS -fno-implicit-prelude #-}
11
12 module  Ratio
13     ( Ratio
14     , Rational
15     , (%)               -- :: (Integral a) => a -> a -> Ratio a
16     , numerator         -- :: (Integral a) => Ratio a -> a
17     , denominator       -- :: (Integral a) => Ratio a -> a
18     , approxRational    -- :: (RealFrac a) => a -> a -> Rational
19
20     -- Ratio instances: 
21     --   (Integral a) => Eq   (Ratio a)
22     --   (Integral a) => Ord  (Ratio a)
23     --   (Integral a) => Num  (Ratio a)
24     --   (Integral a) => Real (Ratio a)
25     --   (Integral a) => Fractional (Ratio a)
26     --   (Integral a) => RealFrac (Ratio a)
27     --   (Integral a) => Enum     (Ratio a)
28     --   (Read a, Integral a) => Read (Ratio a)
29     --   (Integral a) => Show     (Ratio a)
30     --
31     -- Implementation checked wrt. Haskell 98 lib report, 1/99.
32
33   ) where
34
35 #ifndef __HUGS__
36 import PrelNum
37 import PrelNumExtra
38 #endif
39 \end{code}