MonoidAggregator

trait MonoidAggregator[B, A] extends Aggregator[B, A] with Monoid[B]
trait Monoid[B]
trait Semigroup[B]
trait Aggregator[B, A]
trait (B, A) => B
class Object
trait Matchable
class Any

Type members

Inherited classlikes

trait MonoidLaw extends SemigroupLaw

Monoid instances must satisfy scalaz.Semigroup.SemigroupLaw and 2 additional laws:

Monoid instances must satisfy scalaz.Semigroup.SemigroupLaw and 2 additional laws:

  • '''left identity''': forall a. append(zero, a) == a
  • '''right identity''' : forall a. append(a, zero) == a
Inherited from:
Monoid

A semigroup in type F must satisfy two laws:

A semigroup in type F must satisfy two laws:

  • '''closure''': ∀ a, b in F, append(a, b) is also in F. This is enforced by the type system.
  • '''associativity''': ∀ a, b, c in F, the equation append(append(a, b), c) = append(a, append(b , c)) holds.
Inherited from:
Semigroup

Value members

Concrete methods

def initialize(a: A): B

Inherited methods

def append(f1: B, f2: => B): B

The binary operation to combine f1 and f2.

The binary operation to combine f1 and f2.

Implementations should not evaluate the by-name parameter f2 if result can be determined by f1.

Inherited from:
Semigroup
final def applicative: Applicative[[α] =>> B]

A monoidal applicative functor, that implements point and ap with the operations zero and append respectively. Note that the type parameter α in Applicative[λ[α => F]] is discarded; it is a phantom type. As such, the functor cannot support scalaz.Bind.

A monoidal applicative functor, that implements point and ap with the operations zero and append respectively. Note that the type parameter α in Applicative[λ[α => F]] is discarded; it is a phantom type. As such, the functor cannot support scalaz.Bind.

Inherited from:
Monoid
final def apply: Apply[[α] =>> B]

An scalaz.Apply, that implements ap with append. Note that the type parameter α in Apply[λ[α => F]] is discarded; it is a phantom type. As such, the functor cannot support scalaz.Bind.

An scalaz.Apply, that implements ap with append. Note that the type parameter α in Apply[λ[α => F]] is discarded; it is a phantom type. As such, the functor cannot support scalaz.Bind.

Inherited from:
Semigroup
def apply(v1: B, v2: A): B
Inherited from:
Function2
final def category: Category[[α, β] =>> B]

Every Monoid gives rise to a scalaz.Category, for which the type parameters are phantoms.

Every Monoid gives rise to a scalaz.Category, for which the type parameters are phantoms.

Note:

category.monoid = this

Inherited from:
Monoid
final def compose: Compose[[α, β] =>> B]

Every Semigroup gives rise to a scalaz.Compose, for which the type parameters are phantoms.

Every Semigroup gives rise to a scalaz.Compose, for which the type parameters are phantoms.

Note:

compose.semigroup = this

Inherited from:
Semigroup
@unspecialized
def curried: B => A => B
Inherited from:
Function2
final def ifEmpty[B](a: B)(t: => B)(f: => B)(implicit eq: Equal[B]): B
Inherited from:
Monoid
def isMZero(a: B)(implicit eq: Equal[B]): Boolean

Whether a == zero.

Whether a == zero.

Inherited from:
Monoid
Inherited from:
Monoid
def multiply(value: B, n: Int): B

For n = 0, zero For n = 1, append(zero, value) For n = 2, append(append(zero, value), value)

For n = 0, zero For n = 1, append(zero, value) For n = 2, append(append(zero, value), value)

Inherited from:
Monoid
def multiply1(value: B, n: Int): B

For n = 0, value For n = 1, append(value, value) For n = 2, append(append(value, value), value)

For n = 0, value For n = 1, append(value, value) For n = 2, append(append(value, value), value)

The default definition uses peasant multiplication, exploiting associativity to only require O(log n) uses of append

Inherited from:
Semigroup
final def onEmpty[A, B](a: B)(v: => B)(implicit eq: Equal[B], mb: Monoid[B]): B
Inherited from:
Monoid
final def onNotEmpty[B](a: B)(v: => B)(implicit eq: Equal[B], mb: Monoid[B]): B
Inherited from:
Monoid
Inherited from:
Semigroup
override def toString(): String
Definition Classes
Function2 -> Any
Inherited from:
Function2
@unspecialized
def tupled: (B, A) => B
Inherited from:
Function2
def unfoldlSum[S](seed: S)(f: S => Maybe[(S, B)]): B
Inherited from:
Monoid
def unfoldlSumOpt[S](seed: S)(f: S => Maybe[(S, B)]): Maybe[B]

Unfold seed to the left and sum using append. Semigroups with right absorbing elements may override this method to not unfold more than is necessary to determine the result.

Unfold seed to the left and sum using append. Semigroups with right absorbing elements may override this method to not unfold more than is necessary to determine the result.

Inherited from:
Semigroup
def unfoldrSum[S](seed: S)(f: S => Maybe[(B, S)]): B
Inherited from:
Monoid
def unfoldrSumOpt[S](seed: S)(f: S => Maybe[(B, S)]): Maybe[B]

Unfold seed to the right and sum using append. Semigroups with left absorbing elements may override this method to not unfold more than is necessary to determine the result.

Unfold seed to the right and sum using append. Semigroups with left absorbing elements may override this method to not unfold more than is necessary to determine the result.

Inherited from:
Semigroup
def zero: B

The identity element for append.

The identity element for append.

Inherited from:
Monoid

Inherited fields

val monoidSyntax: MonoidSyntax[B]
Inherited from:
Monoid
val semigroupSyntax: SemigroupSyntax[B]
Inherited from:
Semigroup