| 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 |
Data.AdditiveGroup
Description
Groups: zero, addition, and negation (additive inverse)
Documentation
class AdditiveGroup v where Source
Additive group v.
Methods
The zero element: identity for '(^+^)'
(^+^) :: v -> v -> v infixl 6 Source
Add vectors
Additive inverse
(^-^) :: v -> v -> v infixl 6 Source
Group subtraction
Instances
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.