CommutativeMonoid< T> mixin
CommutativeMonoid
represents a commutative monoid.
A monoid is commutative
if for all x
and y
, combine(x, y) == combine(y, x)
.
- Superclass Constraints
- Monoid<
T> - CommutativeSemigroup<
T>
- Monoid<
Properties
- empty → T
-
Return the identity element for this monoid.
read-onlyinherited
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
combine(
T x, T y) → T -
Associative operation which combines two values.
inherited
-
combineN(
T a, int n) → T -
Return
a
appended to itselfn
times.inherited -
intercalate(
T middle) → Semigroup< T> -
Return a
Semigroup
which insertsmiddle
between each pair of elements.inherited -
isEmpty(
T a, Eq< T> eq) → bool -
Tests if
a
is the identity (empty
).inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reverse(
) → CommutativeMonoid< T> -
Return a
CommutativeMonoid
that reverses the order.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
instance<
A>( A emptyValue, A f(A a1, A a2)) → CommutativeMonoid< A> -
Create a
CommutativeMonoid
instance from the given function and empty value.override