algebra-0.9.0.1: Constructive abstract algebra

Synopsis

``` (a + b) + c = a + (b + c)
replicate 1 a = a
replicate (2 * n) a = replicate n a + replicate n a
replicate (2 * n + 1) a = replicate n a + replicate n a + a
```

Methods

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

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

replicate1p n r = replicate (1 + n) r

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

Instances

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

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

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

# Partitionable semigroups

class Additive m => Partitionable m whereSource

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)