Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- divZeroError :: a
- ratioZeroDenominatorError :: a
- overflowError :: a
- underflowError :: a
- data Ratio a = !a :% !a
- type Rational = Ratio Integer
- reduce :: EuclideanDomain a => a -> a -> Ratio a
- (%) :: EuclideanDomain a => a -> a -> Ratio a
- ratioPrec :: Int
- ratioPrec1 :: Int
Documentation
divZeroError :: a Source #
overflowError :: a Source #
underflowError :: a Source #
!a :% !a |
Instances
Show a => Show (Ratio a) Source # | instance (Integral a) => Real (Ratio a) where {-# SPECIALIZE instance Real Rational #-} toRational (x:%y) = toInteger x :% toInteger y Since: 2.0.1 |
EuclideanDomain a => AbelianAdditive (Ratio a) Source # | |
Defined in Algebra.Morphism.Ratio | |
EuclideanDomain a => Additive (Ratio a) Source # | Since: 2.0.1 |
EuclideanDomain a => Division (Ratio a) Source # | Since: 2.0.1 |
EuclideanDomain a => Field (Ratio a) Source # | |
Defined in Algebra.Morphism.Ratio fromRational :: Rational -> Ratio a Source # | |
EuclideanDomain a => Group (Ratio a) Source # | |
EuclideanDomain a => Multiplicative (Ratio a) Source # | |
EuclideanDomain a => Ring (Ratio a) Source # | |
Defined in Algebra.Morphism.Ratio fromInteger :: Integer -> Ratio a Source # | |
Eq a => Eq (Ratio a) Source # | Since: 2.1 |
Integral a => Ord (Ratio a) Source # | Since: 2.0.1 |
EuclideanDomain a => Scalable (Ratio a) (Ratio a) Source # | |
reduce :: EuclideanDomain a => a -> a -> Ratio a Source #
reduce
is a subsidiary function used only in this module.
It normalises a ratio by dividing both numerator and denominator by
their greatest common divisor.
(%) :: EuclideanDomain a => a -> a -> Ratio a Source #
ratioPrec1 :: Int Source #