Safe Haskell | None |
---|---|
Language | Haskell2010 |
A magma heirarchy for multiplication. The basic magma structure is repeated and prefixed with 'Multiplicative-'.
- class MultiplicativeMagma a where
- class MultiplicativeMagma a => MultiplicativeUnital a where
- class MultiplicativeMagma a => MultiplicativeAssociative a
- class MultiplicativeMagma a => MultiplicativeCommutative a
- class MultiplicativeMagma a => MultiplicativeInvertible a where
- product :: (Multiplicative a, Foldable f) => f a -> a
- class (MultiplicativeCommutative a, MultiplicativeUnital a, MultiplicativeAssociative a) => Multiplicative a where
- class (MultiplicativeUnital a, MultiplicativeAssociative a, MultiplicativeInvertible a) => MultiplicativeRightCancellative a where
- class (MultiplicativeUnital a, MultiplicativeAssociative a, MultiplicativeInvertible a) => MultiplicativeLeftCancellative a where
- class (Multiplicative a, MultiplicativeInvertible a) => MultiplicativeGroup a where
- class MultiplicativeMagma a => MultiplicativeIdempotent a
Documentation
class MultiplicativeMagma a where Source #
times
is used as the operator for the multiplicative magam to distinguish from *
which, by convention, implies commutativity
∀ a,b ∈ A: a `times` b ∈ A
law is true by construction in Haskell
class MultiplicativeMagma a => MultiplicativeUnital a where Source #
Unital magma for multiplication.
one `times` a == a a `times` one == a
class MultiplicativeMagma a => MultiplicativeAssociative a Source #
Associative magma for multiplication.
(a `times` b) `times` c == a `times` (b `times` c)
class MultiplicativeMagma a => MultiplicativeCommutative a Source #
Commutative magma for multiplication.
a `times` b == b `times` a
class MultiplicativeMagma a => MultiplicativeInvertible a where Source #
Invertible magma for multiplication.
∀ a ∈ A: recip a ∈ A
law is true by construction in Haskell
MultiplicativeInvertible Double Source # | |
MultiplicativeInvertible Float Source # | |
(AdditiveGroup a, MultiplicativeInvertible a) => MultiplicativeInvertible (Complex a) Source # | |
(Ord a, Signed a, Integral a, AdditiveInvertible a) => MultiplicativeInvertible (Ratio a) Source # | |
product :: (Multiplicative a, Foldable f) => f a -> a Source #
product definition avoiding a clash with the Product monoid in base fixme: fit in with Product in base
class (MultiplicativeCommutative a, MultiplicativeUnital a, MultiplicativeAssociative a) => Multiplicative a where Source #
Multiplicative is commutative, associative and unital under multiplication
one * a == a a * one == a (a * b) * c == a * (b * c) a * b == b * a
class (MultiplicativeUnital a, MultiplicativeAssociative a, MultiplicativeInvertible a) => MultiplicativeRightCancellative a where Source #
Non-commutative right divide
a `times` recip a = one
class (MultiplicativeUnital a, MultiplicativeAssociative a, MultiplicativeInvertible a) => MultiplicativeLeftCancellative a where Source #
Non-commutative left divide
recip a `times` a = one
class (Multiplicative a, MultiplicativeInvertible a) => MultiplicativeGroup a where Source #
Divide (/
) is reserved for where both the left and right cancellative laws hold. This then implies that the MultiplicativeGroup is also Abelian.
a / a = one recip a = one / a recip a * a = one a * recip a = one
MultiplicativeGroup Double Source # | |
MultiplicativeGroup Float Source # | |
(AdditiveGroup a, MultiplicativeGroup a) => MultiplicativeGroup (Complex a) Source # | |
(Signed a, AdditiveInvertible a, AdditiveUnital a, Integral a, Ord a, Multiplicative a) => MultiplicativeGroup (Ratio a) Source # | |
class MultiplicativeMagma a => MultiplicativeIdempotent a Source #
Idempotent magma for multiplication.
a `times` a == a