Copyright | (c) Conal Elliott and Andy J Gill 2008 |
---|---|
License | BSD3 |
Maintainer | conal@conal.net, andygill@ku.edu |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Documentation
class AdditiveGroup v where Source #
Additive group
v
.
Nothing
The zero element: identity for
(^+^)
default zeroV :: ( Generic v, AdditiveGroup (VRep v)) => v Source #
(^+^) :: v -> v -> v infixl 6 Source #
Add vectors
default (^+^) :: ( Generic v, AdditiveGroup (VRep v)) => v -> v -> v Source #
Additive inverse
default negateV :: ( Generic v, AdditiveGroup (VRep v)) => v -> v Source #
(^-^) :: 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
.
Instances
Functor Sum Source # | |
Applicative Sum Source # | |
Bounded a => Bounded ( Sum a) Source # | |
Eq a => Eq ( Sum a) Source # | |
Ord a => Ord ( Sum a) Source # | |
Defined in Data.AdditiveGroup |
|
Read a => Read ( Sum a) Source # | |
Show a => Show ( Sum a) Source # | |
AdditiveGroup a => Semigroup ( Sum a) Source # | |
AdditiveGroup a => Monoid ( Sum a) Source # | |
AdditiveGroup a => AdditiveGroup ( Sum a) Source # | |