connections-0.3.1: Orders, Galois connections, and lattices.

Safe HaskellSafe
LanguageHaskell2010

Data.Connection.Ratio

Contents

Synopsis

Rational

reduce :: Integral a => Ratio a -> Ratio a Source #

A total version of reduce.

shiftr :: Num a => a -> Ratio a -> Ratio a Source #

Shift by n 'units of least precision' where the ULP is determined by the denominator

This is an analog of shift32 for rationals.

data Ratio a #

Rational numbers, with numerator and denominator of some Integral type.

Note that Ratio's instances inherit the deficiencies from the type parameter's. For example, Ratio Natural's Num instance has similar problems to Natural's.

Constructors

!a :% !a 
Instances
Preorder Rational Source # 
Instance details

Defined in Data.Order

Connection k Rational Double Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational Float Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational Bool Source # 
Instance details

Defined in Data.Connection.Class

HasResolution res => Connection k Rational (Extended (Fixed res)) Source # 
Instance details

Defined in Data.Connection.Class

Methods

conn :: Conn k Rational (Extended (Fixed res)) Source #

Connection k Rational (Extended SystemTime) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Integer) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Int) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Int64) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Int32) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Int16) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Int8) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Natural) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Word) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Word64) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Word32) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Word16) Source # 
Instance details

Defined in Data.Connection.Class

Connection k Rational (Extended Word8) Source # 
Instance details

Defined in Data.Connection.Class

Integral a => Enum (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

succ :: Ratio a -> Ratio a #

pred :: Ratio a -> Ratio a #

toEnum :: Int -> Ratio a #

fromEnum :: Ratio a -> Int #

enumFrom :: Ratio a -> [Ratio a] #

enumFromThen :: Ratio a -> Ratio a -> [Ratio a] #

enumFromTo :: Ratio a -> Ratio a -> [Ratio a] #

enumFromThenTo :: Ratio a -> Ratio a -> Ratio a -> [Ratio a] #

Eq a => Eq (Ratio a)

Since: base-2.1

Instance details

Defined in GHC.Real

Methods

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

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

Integral a => Fractional (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

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

recip :: Ratio a -> Ratio a #

fromRational :: Rational -> Ratio a #

Integral a => Num (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

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

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

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

negate :: Ratio a -> Ratio a #

abs :: Ratio a -> Ratio a #

signum :: Ratio a -> Ratio a #

fromInteger :: Integer -> Ratio a #

Integral a => Ord (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

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 #

(Integral a, Read a) => Read (Ratio a)

Since: base-2.1

Instance details

Defined in GHC.Read

Integral a => Real (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

toRational :: Ratio a -> Rational #

Integral a => RealFrac (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

properFraction :: Integral b => Ratio a -> (b, Ratio a) #

truncate :: Integral b => Ratio a -> b #

round :: Integral b => Ratio a -> b #

ceiling :: Integral b => Ratio a -> b #

floor :: Integral b => Ratio a -> b #

Show a => Show (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

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

show :: Ratio a -> String #

showList :: [Ratio a] -> ShowS #