torsor-0.1: Torsor Typeclass

Safe HaskellSafe
LanguageHaskell2010

Torsor

Description

The typeclasses provides in this module are equivalent to three of the typeclasses from the vector-space package. This package uses MPTCs with functional dependencies instead of type families in order to improved error messages.

Documentation

class Additive v where Source #

Minimal complete definition

zero, invert, plus, minus

Methods

zero :: v Source #

invert :: v -> v Source #

plus :: v -> v -> v Source #

minus :: v -> v -> v Source #

Instances

Additive Double Source # 
Additive Int Source # 

Methods

zero :: Int Source #

invert :: Int -> Int Source #

plus :: Int -> Int -> Int Source #

minus :: Int -> Int -> Int Source #

Additive Int8 Source # 
Additive Int16 Source # 
Additive Int32 Source # 
Additive Int64 Source # 
Additive Word Source # 
Additive Word8 Source # 
Additive Word16 Source # 
Additive Word32 Source # 
Additive Word64 Source # 

class Additive v => Torsor p v | p -> v where Source #

Minimal complete definition

add, difference

Methods

add :: v -> p -> p Source #

difference :: p -> p -> v Source #

class (Additive v, Additive s) => Scaling v s | v -> s where Source #

Minimal complete definition

scale

Methods

scale :: s -> v -> v Source #