Contents

Description

Synopsis

class AdditiveMagma a where Source #

plus is used for the additive magma to distinguish from + which, by convention, implies commutativity

Minimal complete definition

plus

Methods

plus :: a -> a -> a Source #

Instances

 Source # Methodsplus :: Bool -> Bool -> Bool Source # Source # Methods Source # Methods Source # Methodsplus :: Int -> Int -> Int Source # Source # Methods Source # Methodsplus :: Complex a -> Complex a -> Complex a Source #

zero plus a == a
a plus zero == a

Minimal complete definition

zero

Methods

zero :: a Source #

Instances

 Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods

(a plus b) plus c == a plus (b plus c)

a plus b == b plus a

∀ a ∈ A: negate a ∈ A

law is true by construction in Haskell

Minimal complete definition

negate

Methods

negate :: a -> a Source #

Instances

 Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methodsnegate :: Complex a -> Complex a Source #

∀ a ∈ A: plushom a ∈ B

law is true by construction in Haskell

Minimal complete definition

plushom

Methods

plushom :: a -> b Source #

Instances

 Source # Methodsplushom :: a -> a Source #

a plus a == a

Instances

 Source #

Instances

 Source # Source # Source # Source # Source # Source #

a + b = b + a
(a + b) + c = a + (b + c)
zero + a = a
a + zero = a

Methods

(+) :: a -> a -> a infixl 6 Source #

Instances

 Source # Methods(+) :: Bool -> Bool -> Bool Source # Source # Methods Source # Methods Source # Methods(+) :: Int -> Int -> Int Source # Source # Methods Additive a => Additive (Complex a) Source # Methods(+) :: Complex a -> Complex a -> Complex a Source #

Non-commutative right minus

Methods

(-~) :: a -> a -> a infixl 6 Source #

Non-commutative left minus

Methods

(~-) :: a -> a -> a infixl 6 Source #

a - a = zero
negate a = zero - a
negate a + a = zero