Skip to content

operators

class Add (A : Type)

Addition: a + b.

class Subtract (A : Type)

Subtraction: a - b.

class Multiply (A : Type)

Multiplication: a * b.

class Divide (A : Type)

Division: a / b.

class Modulo (A : Type)

Remainder: a % b.

class Negate (A : Type)

Negation: -a.

instance natAdd : Add Nat

Addition of naturals.

instance natMultiply : Multiply Nat

Multiplication of naturals.

instance natSubtract : Subtract Nat

Subtraction of naturals, stopping at zero.

instance natDivide : Divide Nat

Division of naturals.

instance natModulo : Modulo Nat

Remainder of naturals.

instance intAdd : Add Int

Addition of integers.

instance intMultiply : Multiply Int

Multiplication of integers.

instance intSubtract : Subtract Int

Subtraction of integers.

instance intNegate : Negate Int

Negation of integers.

instance listAdd {A : Type} : Add (List A)

Lists added end to end: xs + ys is xs followed by ys.