Monoid

trait Monoid[a: Type] with SemiGroup[a]Source

A trait for Monoids, objects that support an associative binary operation combine and neutral element empty.

Signatures

def empty(_unit: Unit): a with Monoid[a] Source

Returns a neutral element.

Trait Definitions

def combine(x: a, y: a): a with Monoid[a] Source

Module Definitions

def fold(f: f[a]): a with Foldable[f], Monoid[a] Source

Returns the result of applying combine to all the elements in t, using empty as the initial value.