algebra-4.2: Constructive abstract algebra

Synopsis

```(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

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

class Additive r => Abelian r Source

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) Euclidean d => Abelian (Fraction d) Abelian r => Abelian (e -> r) (Abelian a, Abelian b) => Abelian (a, b) 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)

class Additive r => Idempotent r Source

`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) 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)

Partitionable semigroups

class Additive m => Partitionable m where Source

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 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)