trait Monoid[A] extends Semigroup[A]
A monoid is a semigroup with an identity. A monoid is a specialization of a
semigroup, so its operation must be associative. Additionally,
op(x, id) == op(id, x) == x. For example, if we have Monoid[String],
with op as string concatenation, then id = "".
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- Monoid
- Semigroup
- Any
- Hide All
- Show All
Visibility
- Public
- All
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
combine(as: TraversableOnce[A]): A
Given a sequence of
as, combine them using the monoid and return the total. -
def
combineOption(as: TraversableOnce[A]): Option[A]
Given a sequence of
as, combine them using the semigroup and return the total.Given a sequence of
as, combine them using the semigroup and return the total.If the sequence is empty, returns None. Otherwise, returns Some(total).
- Definition Classes
- Semigroup
-
def
combinen(a: A, n: Int): A
Return
acombined with itselfntimes. -
def
combinenAboveOne(a: A, n: Int): A
- Attributes
- protected
- Definition Classes
- Semigroup
-
def
equals(arg0: Any): Boolean
- Definition Classes
- Any
-
def
hashCode(): Int
- Definition Classes
- Any
-
def
isId(a: A)(implicit ev: Eq[A]): Boolean
Tests if
ais the identity. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
toString(): String
- Definition Classes
- Any