Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Provides the FromInteger
typeclass.
Since: 0.1
Synopsis
- class FromInteger a where
- afromInteger :: HasCallStack => Integer -> a
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 afromInteger 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
afromInteger :: HasCallStack => Integer -> a Source #
Since: 0.1