connections-0.0.3: Partial orders, Galois connections, and lattices.

Safe HaskellNone
LanguageHaskell2010

Data.Connection.Ratio

Synopsis

Documentation

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

cancel :: Prd a => (Additive - Group) a => Ratio a -> Ratio a Source #

shiftd :: (Additive - Semigroup) a => a -> Ratio a -> Ratio a Source #

class (Prd (Ratio a), Prd b) => TripRatio a b | b -> a where Source #

Methods

ratxxx :: Trip (Ratio a) b Source #

Instances
TripRatio Integer Double Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Integer Float Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Integer (Ratio Integer) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Integer (Nan Ordering) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Integer (Extended Int8) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Integer (Extended Int16) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Integer (Extended Int32) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Integer (Extended Int64) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Integer (Extended Integer) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Natural (Ratio Natural) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Natural (Lifted Natural) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Natural (Lifted Word8) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Natural (Lifted Word16) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Natural (Lifted Word32) Source # 
Instance details

Defined in Data.Connection.Ratio

TripRatio Natural (Lifted Word64) Source # 
Instance details

Defined in Data.Connection.Ratio

fromRational :: TripRatio a b => Ratio a -> b Source #

Lawful replacement for the version in base.

>>> fromRational @Float 1.3
1.3000001
>>> fromRational @Float (1/0)
Infinity
>>> fromRational @Float (0/0)
NaN
>>> fromRational @(Extended Int8) 4.9
Def (fin 5)
>>> fromRational @(Extended Int8) (-1.2)
Def (fin (-1))
>>> fromRational @(Extended Int8) (1/0)
Def Just Top
>>> fromRational @(Extended Int8) (0/0)
Nan
>>> fromRational @(Extended Int8) (-1/0)
Def Nothing