Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Plankton.Integral
Description
Integral classes
- class Ring a => Integral a where
- class ToInteger a where
- class FromInteger a where
- fromIntegral :: (ToInteger a, FromInteger b) => a -> b
Documentation
class Ring a => Integral a where Source #
Integral laws
b == zero || b * (a `div` b) + (a `mod` b) == a
Minimal complete definition
class ToInteger a where Source #
toInteger is kept separate from Integral to help with compatability issues.
Minimal complete definition
class FromInteger a where Source #
fromInteger is the most problematic of the Num
class operators. Particularly heinous, it is assumed that any number type can be constructed from an Integer, so that the broad classes of objects that are composed of multiple elements is avoided in haskell.
Minimal complete definition
Methods
fromInteger :: Integer -> a Source #
Instances
fromIntegral :: (ToInteger a, FromInteger b) => a -> b Source #
coercion of Integral
s
fromIntegral a == a