Portability | requires multi-parameter type classes |
---|---|

Stability | provisional |

Maintainer | numericprelude@henning-thielemann.de |

Safe Haskell | None |

Abstraction of modules

- class (C a, C v) => C a v where
- (*>) :: a -> v -> v

- (<*>.*>) :: C a x => T (a, v) (x -> c) -> (v -> x) -> T (a, v) c
- linearComb :: C a v => [a] -> [v] -> v
- integerMultiply :: (C a, C v) => a -> v -> v
- propCascade :: (Eq v, C a v) => v -> a -> a -> Bool
- propRightDistributive :: (Eq v, C a v) => a -> v -> v -> Bool
- propLeftDistributive :: (Eq v, C a v) => v -> a -> a -> Bool

# Documentation

class (C a, C v) => C a v whereSource

A Module over a ring satisfies:

a *> (b + c) === a *> b + a *> c (a * b) *> c === a *> (b *> c) (a + b) *> c === a *> c + b *> c

C Double Double | |

C Float Float | |

C Int Int | |

C Integer Integer | |

C T T | |

C a => C Integer (T a) | |

C a v => C a [v] | |

C a b => C a (T b) | |

C a b => C a (T b) | |

C a b => C a (T b) | |

(C a v, C v) => C a (T v) | |

C a b => C a (T b) | The '(*>)' method can't replace |

C a b => C a (T b) | |

C a b => C a (T b) | The '(*>)' method can't replace |

C a v => C a (c -> v) | |

(C a b0, C a b1) => C a (b0, b1) | |

(Ord i, Eq a, Eq v, C a v) => C a (Map i v) | |

(C u, C a b) => C a (T u b) | |

(Ord i, C a v) => C a (T i v) | |

C a v => C a (T b v) | |

(C a b0, C a b1, C a b2) => C a (b0, b1, b2) | |

C a => C (T a) (T a) | |

C a v => C (T a) (T v) |

# Instances for atomic types

# Instances for composed types

# Related functions

linearComb :: C a v => [a] -> [v] -> vSource

Compute the linear combination of a list of vectors.

ToDo:
Should it use `zipWith`

?

integerMultiply :: (C a, C v) => a -> v -> vSource

This function can be used to define any
`C`

as a module over `Integer`

.

Better move to Algebra.Additive?

# Properties

propCascade :: (Eq v, C a v) => v -> a -> a -> BoolSource

propRightDistributive :: (Eq v, C a v) => a -> v -> v -> BoolSource

propLeftDistributive :: (Eq v, C a v) => v -> a -> a -> BoolSource