Safe Haskell | None |
---|---|
Language | Haskell2010 |
Provides the FromInteger
and ToInteger
typeclasses.
Since: 0.1
Synopsis
- class FromInteger a where
- fromℤ :: (FromInteger a, HasCallStack) => Integer -> a
- class ToRational a => ToInteger a where
- toℤ :: (HasCallStack, ToInteger a) => a -> Integer
Documentation
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 |
fromℤ :: (FromInteger a, HasCallStack) => Integer -> a Source #
Unicode alias for fromZ
, with U+2114.
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 |