IterableMonoid

@SerialVersionUID(0L) final
class IterableMonoid[A, SA <: IterableOps[A, Iterable, SA]](implicit cbf: Factory[A, SA]) extends Monoid[SA] with Serializable
trait Monoid[SA]
trait Semigroup[SA]
trait Serializable
class Object
trait Matchable
class Any

Value members

Concrete methods

def combine(x: SA, y: SA): SA
override
def combineAll(xs: IterableOnce[SA]): SA
Definition Classes
Monoid
def empty: SA

Inherited methods

override
def combineAllOption(as: IterableOnce[SA]): Option[SA]
Definition Classes
Monoid -> Semigroup
Inherited from
Monoid
override
def combineN(a: SA, n: Int): SA

Return a appended to itself n times.

Return a appended to itself n times.

Example:

scala> import cats.kernel.instances.string._

scala> Monoid[String].combineN("ha", 3)
res0: String = hahaha

scala> Monoid[String].combineN("ha", 0)
res1: String = ""
Definition Classes
Monoid -> Semigroup
Inherited from
Monoid
def intercalate(middle: SA): Semigroup[SA]

Between each pair of elements insert middle This name matches the term used in Foldable and Reducible and a similar Haskell function.

Between each pair of elements insert middle This name matches the term used in Foldable and Reducible and a similar Haskell function.

Inherited from
Semigroup
def isEmpty(a: SA)(implicit ev: Eq[SA]): Boolean

Tests if a is the identity.

Tests if a is the identity.

Example:

scala> import cats.kernel.instances.string._

scala> Monoid[String].isEmpty("")
res0: Boolean = true

scala> Monoid[String].isEmpty("something")
res1: Boolean = false
Inherited from
Monoid
override
def reverse: Monoid[SA]
Definition Classes
Monoid -> Semigroup
Inherited from
Monoid