Data.Num
lib/Data/Num.gob
The arithmetic operators, a class each, so that a type can have + without
having /.
class Add a
fun add : [Add a] fun(a, a) -> a
class Sub a
fun sub : [Sub a] fun(a, a) -> a
class Mul a
fun mul : [Mul a] fun(a, a) -> a
class Div a
fun div : [Div a] fun(a, a) -> a
class Rem a
fun rem : [Rem a] fun(a, a) -> a
class Neg a
fun neg : [Neg a] fun(a) -> a
class Zero a
The identity of + and of *: add(zero(), x) == x == add(x, zero()), and
likewise mul(one(), x) == x == mul(x, one()). Iter.sum and
Iter.product start from them.
fun zero : [Zero a] fun() -> a
class One a
fun one : [One a] fun() -> a
infix Addition (+) = Add.add -- left-associative
infix Addition (-) = Sub.sub -- left-associative
infix Multiplication (*) = Mul.mul -- left-associative
infix Multiplication (/) = Div.div -- left-associative
infix Multiplication (%) = Rem.rem -- left-associative