algebra-3.1: Constructive abstract algebra

Safe Haskell | None

Numeric.Additive.Class

Contents

- Additive Semigroups
- Additive Abelian semigroups
- Additive Monoids
- Partitionable semigroups

Synopsis

- class Additive r where
  - (+) :: r -> r -> r
  - sinnum1p :: Whole n => n -> r -> r
  - sumWith1 :: Foldable1 f => (a -> r) -> f a -> r
- sum1 :: (Foldable1 f, Additive r) => f r -> r
- class Additive r => Abelian r
- class Additive r => Idempotent r
- sinnum1pIdempotent :: Natural -> r -> r
- class Additive m => Partitionable m where
  - partitionWith :: (m -> m -> r) -> m -> NonEmpty r

# 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

Methods

(+) :: r -> r -> rSource

sinnum1p :: Whole n => n -> r -> rSource

sinnum1p n r = sinnum (1 + n) r

sumWith1 :: Foldable1 f => (a -> r) -> f a -> rSource

Instances

Additive Bool |
Additive Int |
Additive Int8 |
Additive Int16 |
Additive Int32 |
Additive Int64 |
Additive Integer |
Additive Word |
Additive Word8 |
Additive Word16 |
Additive Word32 |
Additive Word64 |
Additive () |
Additive Natural |
Additive Euclidean |
Additive r => Additive (Complex r) |
Additive r => Additive (Quaternion r) |
Additive r => Additive (Dual r) |
Additive r => Additive (Hyper' r) |
Additive r => Additive (Hyper r) |
Additive r => Additive (Dual' r) |
Additive (BasisCoblade m) |
Additive r => Additive (Quaternion' r) |
Additive r => Additive (Trig r) |
Multiplicative r => Additive (Log r) |
Additive r => Additive (End r) |
Additive r => Additive (Opposite r) |
Abelian r => Additive (RngRing r) |
Additive r => Additive (ZeroRng r) |
Additive r => Additive (b -> r) |
(Additive a, Additive b) => Additive (a, b) |
(HasTrie b, Additive r) => Additive (:->: b r) |
Additive r => Additive (Covector r a) |
(Additive a, Additive b, Additive c) => Additive (a, b, c) |
Additive r => Additive (Map r b a) |
(Additive a, Additive b, Additive c, Additive d) => Additive (a, b, c, d) |
(Additive a, Additive b, Additive c, Additive d, Additive e) => Additive (a, b, c, d, e) |

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

# Additive Abelian semigroups

class Additive r => Abelian r Source

an additive abelian semigroup

a + b = b + a

Instances

Abelian Bool |
Abelian Int |
Abelian Int8 |
Abelian Int16 |
Abelian Int32 |
Abelian Int64 |
Abelian Integer |
Abelian Word |
Abelian Word8 |
Abelian Word16 |
Abelian Word32 |
Abelian Word64 |
Abelian () |
Abelian Natural |
Abelian Euclidean |
Abelian r => Abelian (Complex r) |
Abelian r => Abelian (Quaternion r) |
Abelian r => Abelian (Dual r) |
Abelian r => Abelian (Hyper' r) |
Abelian r => Abelian (Hyper r) |
Abelian r => Abelian (Dual' r) |
Abelian (BasisCoblade m) |
Abelian r => Abelian (Quaternion' r) |
Abelian r => Abelian (Trig r) |
Commutative r => Abelian (Log r) |
Abelian r => Abelian (End r) |
Abelian r => Abelian (Opposite r) |
Abelian r => Abelian (RngRing r) |
Abelian r => Abelian (ZeroRng r) |
Abelian r => Abelian (e -> r) |
(Abelian a, Abelian b) => Abelian (a, b) |
(HasTrie e, Abelian r) => Abelian (:->: e r) |
Abelian s => Abelian (Covector s a) |
(Abelian a, Abelian b, Abelian c) => Abelian (a, b, c) |
Abelian s => Abelian (Map s b a) |
(Abelian a, Abelian b, Abelian c, Abelian d) => Abelian (a, b, c, d) |
(Abelian a, Abelian b, Abelian c, Abelian d, Abelian e) => Abelian (a, b, c, d, e) |

# Additive Monoids

class Additive r => Idempotent r Source

An additive semigroup with idempotent addition.

     a + a = a

Instances

Idempotent Bool |
Idempotent () |
Idempotent r => Idempotent (Complex r) |
Idempotent r => Idempotent (Quaternion r) |
Idempotent r => Idempotent (Dual r) |
Idempotent r => Idempotent (Hyper' r) |
Idempotent r => Idempotent (Hyper r) |
Idempotent r => Idempotent (Dual' r) |
Idempotent r => Idempotent (Quaternion' r) |
Idempotent r => Idempotent (Trig r) |
Band r => Idempotent (Log r) |
Idempotent r => Idempotent (Opposite r) |
Idempotent r => Idempotent (ZeroRng r) |
Idempotent r => Idempotent (e -> r) |
(Idempotent a, Idempotent b) => Idempotent (a, b) |
(HasTrie e, Idempotent r) => Idempotent (:->: e r) |
Idempotent r => Idempotent (Covector r a) |
(Idempotent a, Idempotent b, Idempotent c) => Idempotent (a, b, c) |
(Idempotent a, Idempotent b, Idempotent c, Idempotent d) => Idempotent (a, b, c, d) |
(Idempotent a, Idempotent b, Idempotent c, Idempotent d, Idempotent e) => Idempotent (a, b, c, d, e) |

sinnum1pIdempotent :: Natural -> r -> rSource

# Partitionable semigroups

class Additive m => Partitionable m where Source

Methods

partitionWith :: (m -> m -> r) -> m -> NonEmpty rSource

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

Instances

Partitionable Bool |
Partitionable () |
Partitionable Natural |
Partitionable r => Partitionable (Complex r) |
Partitionable r => Partitionable (Quaternion r) |
Partitionable r => Partitionable (Dual r) |
Partitionable r => Partitionable (Hyper' r) |
Partitionable r => Partitionable (Hyper r) |
Partitionable r => Partitionable (Dual' r) |
Partitionable r => Partitionable (Quaternion' r) |
Partitionable r => Partitionable (Trig r) |
Factorable r => Partitionable (Log r) |
(Partitionable a, Partitionable b) => Partitionable (a, b) |
(Partitionable a, Partitionable b, Partitionable c) => Partitionable (a, b, c) |
(Partitionable a, Partitionable b, Partitionable c, Partitionable d) => Partitionable (a, b, c, d) |
(Partitionable a, Partitionable b, Partitionable c, Partitionable d, Partitionable e) => Partitionable (a, b, c, d, e) |