| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Precursor.Algebra.Semiring
- class Semiring a where
Documentation
class Semiring a where Source #
A Semiring is like the
the combination of two Monoids. The first
is called +; it has the identity element zero, and it is
commutative. The second is called *; it has identity element one,
and it must distribute over +.
Laws
Normal Monoid laws
Commutativity of +
Distribution of * over +
Another useful law, annihilation, may be deduced from the axioms above:
Methods
The identity of *.
The identity of +.
(*) :: a -> a -> a infixl 7 Source #
An associative binary operation, which distributes over +.
(+) :: a -> a -> a infixl 6 Source #
An associative, commutative binary operation.
The identity of *.
The identity of +.
(+) :: Num a => a -> a -> a infixl 6 Source #
An associative, commutative binary operation.
(*) :: Num a => a -> a -> a infixl 7 Source #
An associative binary operation, which distributes over +.