-
An associative operation to combine values of the implementing type.
This operation must satisfy the semigroup laws:
a.multiply(b).multiply(c) == a.multiply(b.multiply(c))Declaration
Swift
func multiply(_ other: Self) -> SelfParameters
otherValue to multipy with the receiver.
Return Value
Multiplication of the receiver value with the parameter value.
-
zero()Default implementationZero element.
The zero element must obey the semirings laws:
a.multiply(zero()) == zero().multiply(a) == zero()That is, multiplying any element with
zeromust return thezero. It is also an alias foremptyofMonoid.Default Implementation
Declaration
Swift
static func zero() -> SelfReturn Value
A value of the implementing type satisfying the semiring laws.
-
One element.
The one element must obey the semirings laws:
a.multiply(one()) == one().multiply(a) == aThat is, multiplying any element with
onemust return the original element.Declaration
Swift
static func one() -> SelfReturn Value
A value of the implementing type satisfying the semiring laws.
Install in Dash
Semiring Protocol Reference