Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
class Num a where
Basic numeric class.
Minimal complete definition: all except negate
or (-)
(+) :: a -> a -> a infixl 6
(*) :: a -> a -> a infixl 7
(-) :: a -> a -> a infixl 6
negate :: a -> a
Unary negation.
abs :: a -> a
Absolute value.
signum :: a -> a
Sign of a number.
The functions abs
and signum
should satisfy the law:
abs x * signum x == x
For real numbers, the signum
is either -1
(negative), 0
(zero)
or 1
(positive).
fromInteger :: Integer -> a
Conversion from an Integer
.
An integer literal represents the application of the function
fromInteger
to the appropriate value of type Integer
,
so such literals have type (
.Num
a) => a