final class FreeAbGroup[A] extends AnyVal
- Self Type
- FreeAbGroup[A]
- Alphabetic
- By Inheritance
- FreeAbGroup
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
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
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- def inverse: FreeAbGroup[A]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
run[B](f: (A) ⇒ B)(implicit B: AbGroup[B]): B
Maps the terms using
fto typeBand sums their results using the AbGroup forB. -
def
runMonoid[B](f: (A) ⇒ B)(implicit B: CMonoid[B]): Option[B]
As long as there are no negative terms, this maps the terms using
f, then sums the results using the CMonoid forB.As long as there are no negative terms, this maps the terms using
f, then sums the results using the CMonoid forB. If there is a negative term, thenNoneis returned. -
def
runSemigroup[B](f: (A) ⇒ B)(implicit B: CSemigroup[B]): Option[B]
As long as there are no negative terms and at least 1 positive term, this maps the terms using
f, then sums the results using the CSemigroup forB.As long as there are no negative terms and at least 1 positive term, this maps the terms using
f, then sums the results using the CSemigroup forB. If there is a negative term, or if there are no terms at all, thenNoneis returned. -
def
split[B](f: (A) ⇒ B)(implicit B: CMonoid[B]): (B, B)
Sums up the results of the negative and positive terms separately, using
fto map the terms to typeBand using its CMonoid.Sums up the results of the negative and positive terms separately, using
fto map the terms to typeBand using its CMonoid. This returns a tuple with the sum of the negative terms on the left and the sum of the positive terms on the right. -
def
splitSemigroup[B](f: (A) ⇒ B)(implicit B: CSemigroup[B]): (Option[B], Option[B])
Sums up the results of the negative and positive terms separately, using
fto map the terms to typeBand using its CSemigroup.Sums up the results of the negative and positive terms separately, using
fto map the terms to typeBand using its CSemigroup. This returns a tuple with the sum of the negative terms on the left and the sum of the positive terms on the right. If either side has no terms at all, then that side isNone. - val terms: Map[A, Int]
-
def
toString(): String
- Definition Classes
- FreeAbGroup → Any
- def |+|(rhs: FreeAbGroup[A]): FreeAbGroup[A]
- def |-|(rhs: FreeAbGroup[A]): FreeAbGroup[A]