File: Ratio.hs

package info (click to toggle)
haskell98-report 20030706-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,888 kB
  • ctags: 77
  • sloc: haskell: 3,809; makefile: 326; sh: 4
file content (19 lines) | stat: -rw-r--r-- 848 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module	Ratio (
    Ratio, Rational, (%), numerator, denominator, approxRational ) where

infixl 7  %
data  (Integral a)	=> Ratio a = ...
type  Rational		=  Ratio Integer
(%)			:: (Integral a) => a -> a -> Ratio a
numerator, denominator	:: (Integral a) => Ratio a -> a
approxRational		:: (RealFrac a) => a -> a -> Rational
instance  (Integral a)  => Eq         (Ratio a)  where ...
instance  (Integral a)	=> Ord        (Ratio a)  where ...
instance  (Integral a)	=> Num        (Ratio a)  where ...
instance  (Integral a)	=> Real       (Ratio a)  where ...
instance  (Integral a)	=> Fractional (Ratio a)  where ...
instance  (Integral a)	=> RealFrac   (Ratio a)  where ...
instance  (Integral a)	=> Enum       (Ratio a)  where ...
instance  (Read a,Integral a) => Read (Ratio a)  where ...
instance  (Integral a)  => Show       (Ratio a)  where ...