| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Numeric.Convert.Internal
Description
Since: 0.1
Synopsis
- class FromInteger a where
- class ToRational a => ToInteger a where
- class FromInteger a => FromRational a where
- class ToReal a => ToRational a where
- class FromRational a => FromReal a where
- class ToReal a where
Integers
class FromInteger a where Source #
Replaces base's fromInteger functionality for when we do not have a
Num instance.
1_000 :: Num a => a -- becomes fromZ 1_000 :: FromInteger a => a
Note that fromInteger's deficiencies are inherited e.g. Natural is
partial, bounded types have over/underflow issues.
Since: 0.1
Instances
| FromInteger Int16 Source # | Since: 0.1 |
| FromInteger Int32 Source # | Since: 0.1 |
| FromInteger Int64 Source # | Since: 0.1 |
| FromInteger Int8 Source # | Since: 0.1 |
| FromInteger Word16 Source # | Since: 0.1 |
| FromInteger Word32 Source # | Since: 0.1 |
| FromInteger Word64 Source # | Since: 0.1 |
| FromInteger Word8 Source # | Since: 0.1 |
| FromInteger Integer Source # | Since: 0.1 |
| FromInteger Natural Source # | WARNING: Partial Since: 0.1 |
| FromInteger Double Source # | Since: 0.1 |
| FromInteger Float Source # | Since: 0.1 |
| FromInteger Int Source # | Since: 0.1 |
| FromInteger Word Source # | Since: 0.1 |
| RealFloat a => FromInteger (Complex a) Source # | Since: 0.1 |
| FromInteger (Ratio Integer) Source # | Since: 0.1 |
| FromInteger (Ratio Natural) Source # | WARNING: Partial Since: 0.1 |
| HasResolution k => FromInteger (Fixed k) Source # | Since: 0.1 |
class ToRational a => ToInteger a where Source #
Integer embedding.
Since: 0.1
Instances
| ToInteger Int16 Source # | Since: 0.1 |
| ToInteger Int32 Source # | Since: 0.1 |
| ToInteger Int64 Source # | Since: 0.1 |
| ToInteger Int8 Source # | Since: 0.1 |
| ToInteger Word16 Source # | Since: 0.1 |
| ToInteger Word32 Source # | Since: 0.1 |
| ToInteger Word64 Source # | Since: 0.1 |
| ToInteger Word8 Source # | Since: 0.1 |
| ToInteger Integer Source # | Since: 0.1 |
| ToInteger Natural Source # | Since: 0.1 |
| ToInteger Int Source # | Since: 0.1 |
| ToInteger Word Source # | Since: 0.1 |
Rationals
class FromInteger a => FromRational a where Source #
Replaces base's fromRational functionality for when we do not have a
Fractional instance.
5.5 :: Fractional a => a -- becomes fromQ 5.5 :: FromRational a => a
Note that fromRational's deficiencies are inherited e.g. Natural is
partial, bounded types have over/underflow issues.
Since: 0.1
Instances
| FromRational Double Source # | Since: 0.1 |
| FromRational Float Source # | Since: 0.1 |
| RealFloat a => FromRational (Complex a) Source # | Since: 0.1 |
| FromRational (Ratio Integer) Source # | Since: 0.1 |
| FromRational (Ratio Natural) Source # | WARNING: Partial Since: 0.1 |
| HasResolution k => FromRational (Fixed k) Source # | Since: 0.1 |
class ToReal a => ToRational a where Source #
Rational embedding.
Since: 0.1
Instances
| ToRational Int16 Source # | Since: 0.1 |
| ToRational Int32 Source # | Since: 0.1 |
| ToRational Int64 Source # | Since: 0.1 |
| ToRational Int8 Source # | Since: 0.1 |
| ToRational Word16 Source # | Since: 0.1 |
| ToRational Word32 Source # | Since: 0.1 |
| ToRational Word64 Source # | Since: 0.1 |
| ToRational Word8 Source # | Since: 0.1 |
| ToRational Integer Source # | Since: 0.1 |
| ToRational Natural Source # | Since: 0.1 |
| ToRational Double Source # | Since: 0.1 |
| ToRational Float Source # | Since: 0.1 |
| ToRational Int Source # | Since: 0.1 |
| ToRational Word Source # | Since: 0.1 |
| ToRational (Ratio Integer) Source # | Since: 0.1 |
| ToRational (Ratio Natural) Source # | Since: 0.1 |
| HasResolution k => ToRational (Fixed k) Source # | Since: 0.1 |
Reals
class FromRational a => FromReal a where Source #
Conversion from Double.
Since: 0.1
Conversion to Double.
Since: 0.1
Instances
| ToReal Int16 Source # | Since: 0.1 |
| ToReal Int32 Source # | Since: 0.1 |
| ToReal Int64 Source # | Since: 0.1 |
| ToReal Int8 Source # | Since: 0.1 |
| ToReal Word16 Source # | Since: 0.1 |
| ToReal Word32 Source # | Since: 0.1 |
| ToReal Word64 Source # | Since: 0.1 |
| ToReal Word8 Source # | Since: 0.1 |
| ToReal Integer Source # | Since: 0.1 |
| ToReal Natural Source # | Since: 0.1 |
| ToReal Double Source # | Since: 0.1 |
| ToReal Float Source # | Since: 0.1 |
| ToReal Int Source # | Since: 0.1 |
| ToReal Word Source # | Since: 0.1 |
| ToReal (Ratio Integer) Source # | Since: 0.1 |
| ToReal (Ratio Natural) Source # | Since: 0.1 |
| HasResolution k => ToReal (Fixed k) Source # | Since: 0.1 |