Copyright | (c) Conal Elliott and Andy J Gill 2008 |
---|---|
License | BSD3 |
Maintainer | conal@conal.net, andygill@ku.edu |
Stability | experimental |
Safe Haskell | None |
Language | Haskell98 |
Groups: zero, addition, and negation (additive inverse)
Documentation
class AdditiveGroup v where Source
Additive group v
.
The zero element: identity for '(^+^)'
(^+^) :: v -> v -> v infixl 6 Source
Add vectors
Additive inverse
(^-^) :: v -> v -> v infixl 6 Source
Group subtraction
AdditiveGroup Double | |
AdditiveGroup Float | |
AdditiveGroup Int | |
AdditiveGroup Integer | |
AdditiveGroup () | |
AdditiveGroup CSChar | |
AdditiveGroup CShort | |
AdditiveGroup CInt | |
AdditiveGroup CLong | |
AdditiveGroup CLLong | |
AdditiveGroup CFloat | |
AdditiveGroup CDouble | |
AdditiveGroup CIntMax | |
Integral a => AdditiveGroup (Ratio a) | |
(RealFloat v, AdditiveGroup v) => AdditiveGroup (Complex v) | |
AdditiveGroup a => AdditiveGroup (Maybe a) | |
AdditiveGroup a => AdditiveGroup (Sum a) | |
AdditiveGroup v => AdditiveGroup (a -> v) | |
(AdditiveGroup u, AdditiveGroup v) => AdditiveGroup (u, v) | |
(HasTrie u, AdditiveGroup v) => AdditiveGroup ((:->:) u v) | |
(HasTrie (Basis u), AdditiveGroup v) => AdditiveGroup ((:-*) u v) | |
(HasBasis a, HasTrie (Basis a), AdditiveGroup u) => AdditiveGroup ((:>) a u) | |
(AdditiveGroup u, AdditiveGroup v, AdditiveGroup w) => AdditiveGroup (u, v, w) | |
(AdditiveGroup u, AdditiveGroup v, AdditiveGroup w, AdditiveGroup x) => AdditiveGroup (u, v, w, x) |
sumV :: (Foldable f, AdditiveGroup v) => f v -> v Source
Sum over several vectors
Monoid under group addition. Alternative to the Sum
in
Data.Monoid, which uses Num
instead of AdditiveGroup
.