gasp-1.4.0.0: A framework of algebraic classes
Safe HaskellSafe-Inferred
LanguageHaskell2010

Algebra.Morphism.Ratio

Synopsis

Documentation

data Ratio a Source #

Constructors

!a :% !a 

Instances

Instances details
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

Instance details

Defined in Algebra.Morphism.Ratio

Methods

showsPrec :: Int -> Ratio a -> ShowS #

show :: Ratio a -> String #

showList :: [Ratio a] -> ShowS #

EuclideanDomain a => AbelianAdditive (Ratio a) Source # 
Instance details

Defined in Algebra.Morphism.Ratio

EuclideanDomain a => Additive (Ratio a) Source #

Since: 2.0.1

Instance details

Defined in Algebra.Morphism.Ratio

Methods

(+) :: Ratio a -> Ratio a -> Ratio a Source #

zero :: Ratio a Source #

times :: Natural -> Ratio a -> Ratio a Source #

EuclideanDomain a => Division (Ratio a) Source #

Since: 2.0.1

Instance details

Defined in Algebra.Morphism.Ratio

Methods

recip :: Ratio a -> Ratio a Source #

(/) :: Ratio a -> Ratio a -> Ratio a Source #

(^) :: Ratio a -> Integer -> Ratio a Source #

EuclideanDomain a => Field (Ratio a) Source # 
Instance details

Defined in Algebra.Morphism.Ratio

EuclideanDomain a => Group (Ratio a) Source # 
Instance details

Defined in Algebra.Morphism.Ratio

Methods

(-) :: Ratio a -> Ratio a -> Ratio a Source #

subtract :: Ratio a -> Ratio a -> Ratio a Source #

negate :: Ratio a -> Ratio a Source #

mult :: Integer -> Ratio a -> Ratio a Source #

EuclideanDomain a => Multiplicative (Ratio a) Source # 
Instance details

Defined in Algebra.Morphism.Ratio

Methods

(*) :: Ratio a -> Ratio a -> Ratio a Source #

one :: Ratio a Source #

(^+) :: Ratio a -> Natural -> Ratio a Source #

EuclideanDomain a => Ring (Ratio a) Source # 
Instance details

Defined in Algebra.Morphism.Ratio

Eq a => Eq (Ratio a) Source #

Since: 2.1

Instance details

Defined in Algebra.Morphism.Ratio

Methods

(==) :: Ratio a -> Ratio a -> Bool #

(/=) :: Ratio a -> Ratio a -> Bool #

Integral a => Ord (Ratio a) Source #

Since: 2.0.1

Instance details

Defined in Algebra.Morphism.Ratio

Methods

compare :: Ratio a -> Ratio a -> Ordering #

(<) :: Ratio a -> Ratio a -> Bool #

(<=) :: Ratio a -> Ratio a -> Bool #

(>) :: Ratio a -> Ratio a -> Bool #

(>=) :: Ratio a -> Ratio a -> Bool #

max :: Ratio a -> Ratio a -> Ratio a #

min :: Ratio a -> Ratio a -> Ratio a #

EuclideanDomain a => Scalable (Ratio a) (Ratio a) Source # 
Instance details

Defined in Algebra.Morphism.Ratio

Methods

(*^) :: Ratio a -> 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 #