NumericPrelude-0.0: An experimental alternative hierarchy of numeric type classesContentsIndex
Number.Ratio
Portabilityportable (?)
Stabilityprovisional
Maintainernumericprelude@henning-thielemann.de
Description
Ratios of mathematical objects.
Synopsis
data T a = (:%) {
numerator :: !a
denominator :: !a
}
(%) :: C a => a -> a -> T a
type Rational = T Integer
fromValue :: C a => a -> T a
scale :: C a => a -> T a -> T a
split :: C a => T a -> (a, T a)
showsPrecAuto :: (Eq a, C a, Show a) => Int -> T a -> String -> String
Documentation
data T a
Constructors
(:%)
numerator :: !a
denominator :: !a
show/hide Instances
(Arbitrary a, C a, C a) => Arbitrary (T a)
C a => C (T a)
C a => C (T a)
(Ord a, C a) => C (T a)
(C a, C a) => C (T a)
C a => C (T a)
(Ord a, C a) => C (T a)
C a => Divisible (T a)
Eq a => Eq (T a)
(Num a, C a) => Fractional (T a)
(Num a, C a) => Num (T a)
(Ord a, C a) => Ord (T a)
(Read a, C a) => Read (T a)
(Real a, C a) => Real (T a)
(ToInteger a, C a) => RealFrac (T a)
(Show a, C a) => Show (T a)
(ToInteger a, C a) => ToRational (T a)
(%) :: C a => a -> a -> T a
type Rational = T Integer
fromValue :: C a => a -> T a
scale :: C a => a -> T a -> T a
split :: C a => T a -> (a, T a)
similar to splitFraction
showsPrecAuto :: (Eq a, C a, Show a) => Int -> T a -> String -> String
This is an alternative show method that is more user-friendly but also potentially more ambigious.
Produced by Haddock version 0.7