- class Additive r where
- (+) :: r -> r -> r
- replicate1p :: 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
- replicate1pIdempotent :: Natural -> r -> r
- class Additive m => Partitionable m where
- partitionWith :: (m -> m -> r) -> m -> NonEmpty r
Additive Semigroups
(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
replicate1p :: Whole n => n -> r -> rSource
replicate1p n r = replicate (1 + n) r
Additive Abelian semigroups
class Additive r => Abelian r Source
an additive abelian semigroup
a + b = b + a
Additive Monoids
class Additive r => Idempotent r Source
An additive semigroup with idempotent addition.
a + a = a
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) |
replicate1pIdempotent :: Natural -> r -> rSource
Partitionable semigroups
class Additive m => Partitionable m whereSource
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,
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) |