Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- reduce :: Integral a => a -> a -> Ratio a
- cancel :: Prd a => (Additive - Group) a => Ratio a -> Ratio a
- shiftd :: (Additive - Semigroup) a => a -> Ratio a -> Ratio a
- class (Prd (Ratio a), Prd b) => TripRatio a b | b -> a where
- fromRational :: TripRatio a b => Ratio a -> b
- ratf32 :: Trip (Ratio Integer) Float
- ratf64 :: Trip (Ratio Integer) Double
- rati08 :: Trip (Ratio Integer) (Extended Int8)
- rati16 :: Trip (Ratio Integer) (Extended Int16)
- rati32 :: Trip (Ratio Integer) (Extended Int32)
- rati64 :: Trip (Ratio Integer) (Extended Int64)
- ratint :: Trip (Ratio Integer) (Extended Integer)
- ratw08 :: Trip (Ratio Natural) (Lifted Word8)
- ratw16 :: Trip (Ratio Natural) (Lifted Word16)
- ratw32 :: Trip (Ratio Natural) (Lifted Word32)
- ratw64 :: Trip (Ratio Natural) (Lifted Word64)
- ratnat :: Trip (Ratio Natural) (Lifted Natural)
Documentation
class (Prd (Ratio a), Prd b) => TripRatio a b | b -> a where Source #
Instances
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