algebra-4.3.1: Constructive abstract algebra

Safe HaskellSafe
LanguageHaskell98

Numeric.Additive.Class

Contents

Synopsis

Additive Semigroups

class Additive r where Source #

(a + b) + c = a + (b + c)
sinnum 1 a = a
sinnum (2 * n) a = sinnum n a + sinnum n a
sinnum (2 * n + 1) a = sinnum n a + sinnum n a + a

Minimal complete definition

(+)

Methods

(+) :: r -> r -> r infixl 6 Source #

sinnum1p :: Natural -> r -> r Source #

sinnum1p n r = sinnum (1 + n) r

sumWith1 :: Foldable1 f => (a -> r) -> f a -> r Source #

Instances

Additive Bool Source # 

Methods

(+) :: Bool -> Bool -> Bool Source #

sinnum1p :: Natural -> Bool -> Bool Source #

sumWith1 :: Foldable1 f => (a -> Bool) -> f a -> Bool Source #

Additive Int Source # 

Methods

(+) :: Int -> Int -> Int Source #

sinnum1p :: Natural -> Int -> Int Source #

sumWith1 :: Foldable1 f => (a -> Int) -> f a -> Int Source #

Additive Int8 Source # 

Methods

(+) :: Int8 -> Int8 -> Int8 Source #

sinnum1p :: Natural -> Int8 -> Int8 Source #

sumWith1 :: Foldable1 f => (a -> Int8) -> f a -> Int8 Source #

Additive Int16 Source # 

Methods

(+) :: Int16 -> Int16 -> Int16 Source #

sinnum1p :: Natural -> Int16 -> Int16 Source #

sumWith1 :: Foldable1 f => (a -> Int16) -> f a -> Int16 Source #

Additive Int32 Source # 

Methods

(+) :: Int32 -> Int32 -> Int32 Source #

sinnum1p :: Natural -> Int32 -> Int32 Source #

sumWith1 :: Foldable1 f => (a -> Int32) -> f a -> Int32 Source #

Additive Int64 Source # 

Methods

(+) :: Int64 -> Int64 -> Int64 Source #

sinnum1p :: Natural -> Int64 -> Int64 Source #

sumWith1 :: Foldable1 f => (a -> Int64) -> f a -> Int64 Source #

Additive Integer Source # 
Additive Natural Source # 
Additive Word Source # 

Methods

(+) :: Word -> Word -> Word Source #

sinnum1p :: Natural -> Word -> Word Source #

sumWith1 :: Foldable1 f => (a -> Word) -> f a -> Word Source #

Additive Word8 Source # 

Methods

(+) :: Word8 -> Word8 -> Word8 Source #

sinnum1p :: Natural -> Word8 -> Word8 Source #

sumWith1 :: Foldable1 f => (a -> Word8) -> f a -> Word8 Source #

Additive Word16 Source # 
Additive Word32 Source # 
Additive Word64 Source # 
Additive () Source # 

Methods

(+) :: () -> () -> () Source #

sinnum1p :: Natural -> () -> () Source #

sumWith1 :: Foldable1 f => (a -> ()) -> f a -> () Source #

Additive Euclidean Source # 
Additive r => Additive (ZeroRng r) Source # 

Methods

(+) :: ZeroRng r -> ZeroRng r -> ZeroRng r Source #

sinnum1p :: Natural -> ZeroRng r -> ZeroRng r Source #

sumWith1 :: Foldable1 f => (a -> ZeroRng r) -> f a -> ZeroRng r Source #

Abelian r => Additive (RngRing r) Source # 

Methods

(+) :: RngRing r -> RngRing r -> RngRing r Source #

sinnum1p :: Natural -> RngRing r -> RngRing r Source #

sumWith1 :: Foldable1 f => (a -> RngRing r) -> f a -> RngRing r Source #

Additive r => Additive (Opposite r) Source # 

Methods

(+) :: Opposite r -> Opposite r -> Opposite r Source #

sinnum1p :: Natural -> Opposite r -> Opposite r Source #

sumWith1 :: Foldable1 f => (a -> Opposite r) -> f a -> Opposite r Source #

Additive r => Additive (End r) Source # 

Methods

(+) :: End r -> End r -> End r Source #

sinnum1p :: Natural -> End r -> End r Source #

sumWith1 :: Foldable1 f => (a -> End r) -> f a -> End r Source #

Multiplicative r => Additive (Log r) Source # 

Methods

(+) :: Log r -> Log r -> Log r Source #

sinnum1p :: Natural -> Log r -> Log r Source #

sumWith1 :: Foldable1 f => (a -> Log r) -> f a -> Log r Source #

Additive r => Additive (Trig r) Source # 

Methods

(+) :: Trig r -> Trig r -> Trig r Source #

sinnum1p :: Natural -> Trig r -> Trig r Source #

sumWith1 :: Foldable1 f => (a -> Trig r) -> f a -> Trig r Source #

Additive r => Additive (Quaternion' r) Source # 
Additive r => Additive (Hyper r) Source # 

Methods

(+) :: Hyper r -> Hyper r -> Hyper r Source #

sinnum1p :: Natural -> Hyper r -> Hyper r Source #

sumWith1 :: Foldable1 f => (a -> Hyper r) -> f a -> Hyper r Source #

Additive (BasisCoblade m) Source # 
Additive r => Additive (Dual' r) Source # 

Methods

(+) :: Dual' r -> Dual' r -> Dual' r Source #

sinnum1p :: Natural -> Dual' r -> Dual' r Source #

sumWith1 :: Foldable1 f => (a -> Dual' r) -> f a -> Dual' r Source #

Additive r => Additive (Quaternion r) Source # 
Additive r => Additive (Hyper' r) Source # 

Methods

(+) :: Hyper' r -> Hyper' r -> Hyper' r Source #

sinnum1p :: Natural -> Hyper' r -> Hyper' r Source #

sumWith1 :: Foldable1 f => (a -> Hyper' r) -> f a -> Hyper' r Source #

Additive r => Additive (Dual r) Source # 

Methods

(+) :: Dual r -> Dual r -> Dual r Source #

sinnum1p :: Natural -> Dual r -> Dual r Source #

sumWith1 :: Foldable1 f => (a -> Dual r) -> f a -> Dual r Source #

Additive r => Additive (Complex r) Source # 

Methods

(+) :: Complex r -> Complex r -> Complex r Source #

sinnum1p :: Natural -> Complex r -> Complex r Source #

sumWith1 :: Foldable1 f => (a -> Complex r) -> f a -> Complex r Source #

GCDDomain d => Additive (Fraction d) Source # 

Methods

(+) :: Fraction d -> Fraction d -> Fraction d Source #

sinnum1p :: Natural -> Fraction d -> Fraction d Source #

sumWith1 :: Foldable1 f => (a -> Fraction d) -> f a -> Fraction d Source #

Additive r => Additive (b -> r) Source # 

Methods

(+) :: (b -> r) -> (b -> r) -> b -> r Source #

sinnum1p :: Natural -> (b -> r) -> b -> r Source #

sumWith1 :: Foldable1 f => (a -> b -> r) -> f a -> b -> r Source #

(Additive a, Additive b) => Additive (a, b) Source # 

Methods

(+) :: (a, b) -> (a, b) -> (a, b) Source #

sinnum1p :: Natural -> (a, b) -> (a, b) Source #

sumWith1 :: Foldable1 f => (a -> (a, b)) -> f a -> (a, b) Source #

Additive r => Additive (Covector r a) Source # 

Methods

(+) :: Covector r a -> Covector r a -> Covector r a Source #

sinnum1p :: Natural -> Covector r a -> Covector r a Source #

sumWith1 :: Foldable1 f => (a -> Covector r a) -> f a -> Covector r a Source #

(Additive a, Additive b, Additive c) => Additive (a, b, c) Source # 

Methods

(+) :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #

sinnum1p :: Natural -> (a, b, c) -> (a, b, c) Source #

sumWith1 :: Foldable1 f => (a -> (a, b, c)) -> f a -> (a, b, c) Source #

Additive r => Additive (Map r b a) Source # 

Methods

(+) :: Map r b a -> Map r b a -> Map r b a Source #

sinnum1p :: Natural -> Map r b a -> Map r b a Source #

sumWith1 :: Foldable1 f => (a -> Map r b a) -> f a -> Map r b a Source #

(Additive a, Additive b, Additive c, Additive d) => Additive (a, b, c, d) Source # 

Methods

(+) :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #

sinnum1p :: Natural -> (a, b, c, d) -> (a, b, c, d) Source #

sumWith1 :: Foldable1 f => (a -> (a, b, c, d)) -> f a -> (a, b, c, d) Source #

(Additive a, Additive b, Additive c, Additive d, Additive e) => Additive (a, b, c, d, e) Source # 

Methods

(+) :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

sinnum1p :: Natural -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

sumWith1 :: Foldable1 f => (a -> (a, b, c, d, e)) -> f a -> (a, b, c, d, e) Source #

sum1 :: (Foldable1 f, Additive r) => f r -> r Source #

Additive Abelian semigroups

class Additive r => Abelian r Source #

an additive abelian semigroup

a + b = b + a

Additive Monoids

Partitionable semigroups

class Additive m => Partitionable m where Source #

Minimal complete definition

partitionWith

Methods

partitionWith :: (m -> m -> r) -> m -> NonEmpty r Source #

partitionWith f c returns a list containing f a b for each a b such that a + b = c,

Instances

Partitionable Bool Source # 

Methods

partitionWith :: (Bool -> Bool -> r) -> Bool -> NonEmpty r Source #

Partitionable Natural Source # 

Methods

partitionWith :: (Natural -> Natural -> r) -> Natural -> NonEmpty r Source #

Partitionable () Source # 

Methods

partitionWith :: (() -> () -> r) -> () -> NonEmpty r Source #

Factorable r => Partitionable (Log r) Source # 

Methods

partitionWith :: (Log r -> Log r -> r) -> Log r -> NonEmpty r Source #

Partitionable r => Partitionable (Trig r) Source # 

Methods

partitionWith :: (Trig r -> Trig r -> r) -> Trig r -> NonEmpty r Source #

Partitionable r => Partitionable (Quaternion' r) Source # 
Partitionable r => Partitionable (Hyper r) Source # 

Methods

partitionWith :: (Hyper r -> Hyper r -> r) -> Hyper r -> NonEmpty r Source #

Partitionable r => Partitionable (Dual' r) Source # 

Methods

partitionWith :: (Dual' r -> Dual' r -> r) -> Dual' r -> NonEmpty r Source #

Partitionable r => Partitionable (Quaternion r) Source # 

Methods

partitionWith :: (Quaternion r -> Quaternion r -> r) -> Quaternion r -> NonEmpty r Source #

Partitionable r => Partitionable (Hyper' r) Source # 

Methods

partitionWith :: (Hyper' r -> Hyper' r -> r) -> Hyper' r -> NonEmpty r Source #

Partitionable r => Partitionable (Dual r) Source # 

Methods

partitionWith :: (Dual r -> Dual r -> r) -> Dual r -> NonEmpty r Source #

Partitionable r => Partitionable (Complex r) Source # 

Methods

partitionWith :: (Complex r -> Complex r -> r) -> Complex r -> NonEmpty r Source #

(Partitionable a, Partitionable b) => Partitionable (a, b) Source # 

Methods

partitionWith :: ((a, b) -> (a, b) -> r) -> (a, b) -> NonEmpty r Source #

(Partitionable a, Partitionable b, Partitionable c) => Partitionable (a, b, c) Source # 

Methods

partitionWith :: ((a, b, c) -> (a, b, c) -> r) -> (a, b, c) -> NonEmpty r Source #

(Partitionable a, Partitionable b, Partitionable c, Partitionable d) => Partitionable (a, b, c, d) Source # 

Methods

partitionWith :: ((a, b, c, d) -> (a, b, c, d) -> r) -> (a, b, c, d) -> NonEmpty r Source #

(Partitionable a, Partitionable b, Partitionable c, Partitionable d, Partitionable e) => Partitionable (a, b, c, d, e) Source # 

Methods

partitionWith :: ((a, b, c, d, e) -> (a, b, c, d, e) -> r) -> (a, b, c, d, e) -> NonEmpty r Source #