FreeMonoid

final class FreeMonoid[A] extends AnyVal
Companion:
object
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def run[B](f: A => B)(implicit B: Monoid[B]): B

Map each term to type B and sum them using B's Monoid.

Map each term to type B and sum them using B's Monoid.

def runSemigroup[B](f: A => B)(implicit B: Semigroup[B]): Option[B]

Map each term to type B and sum them using B's Semigroup, as long as there is at least 1 term. Otherwise, return None.

Map each term to type B and sum them using B's Semigroup, as long as there is at least 1 term. Otherwise, return None.

override def toString: String
Definition Classes
Any
def |+|(rhs: FreeMonoid[A]): FreeMonoid[A]

Concrete fields

val terms: List[A]