vector-space-0.7.6: Vector & affine spaces, linear maps, and derivatives (requires ghc 6.9 or better)Source codeContentsIndex
Data.AdditiveGroup
Stabilityexperimental
Maintainerconal@conal.net, andygill@ku.edu
Description
Groups: zero, addition, and negation (additive inverse)
Synopsis
class AdditiveGroup v where
zeroV :: v
(^+^) :: v -> v -> v
negateV :: v -> v
(^-^) :: AdditiveGroup v => v -> v -> v
sumV :: (Foldable f, AdditiveGroup v) => f v -> v
newtype Sum a = Sum {
getSum :: a
}
inSum :: (a -> b) -> Sum a -> Sum b
inSum2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c
Documentation
class AdditiveGroup v whereSource
Additive group v.
Methods
zeroV :: vSource
The zero element: identity for '(^+^)'
(^+^) :: v -> v -> vSource
Add vectors
negateV :: v -> vSource
Additive inverse
show/hide Instances
(^-^) :: AdditiveGroup v => v -> v -> vSource
Group subtraction
sumV :: (Foldable f, AdditiveGroup v) => f v -> vSource
Sum over several vectors
newtype Sum a Source
Monoid under group addition. Alternative to the Sum in Data.Monoid, which uses Num instead of AdditiveGroup.
Constructors
Sum
getSum :: a
show/hide Instances
inSum :: (a -> b) -> Sum a -> Sum bSource
Application a unary function inside a Sum
inSum2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum cSource
Application a binary function inside a Sum
Produced by Haddock version 2.6.1