class EventuallySemigroup[E, O] extends Semigroup[Either[E, O]]
Classes that support algebraic structures with dynamic switching between two representations, the original type O and the eventual type E. In the case of Semigroup, we specify
- Two Semigroups eventualSemigroup and originalSemigroup
- A Semigroup homomorphism convert: O => E
- A conditional mustConvert: O => Boolean Then we get a Semigroup[Either[E,O]], where: Left(x) + Left(y)
Left(x+y) Left(x) + Right(y)
Right(y) = Left(convert(x+y)) if mustConvert(x+y) Right(x+y) otherwise. EventuallyMonoid, EventuallyGroup, and EventuallyRing are defined analogously, with the contract that convert respect the appropriate structure.
- Alphabetic
- By Inheritance
- EventuallySemigroup
- Semigroup
- AdditiveSemigroup
- Semigroup
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def additive: algebra.Semigroup[Either[E, O]]
- Definition Classes
- Semigroup → AdditiveSemigroup
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def combine(l: Either[E, O], r: Either[E, O]): Either[E, O]
- Definition Classes
- Semigroup → Semigroup
- def combineAllOption(iter: TraversableOnce[Either[E, O]]): Option[Either[E, O]]
- Definition Classes
- Semigroup → Semigroup
- def combineN(a: Either[E, O], n: Int): Either[E, O]
- Definition Classes
- Semigroup
- def conditionallyConvert(o: O): Either[E, O]
- Attributes
- protected
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def left(e: E): Either[E, O]
- Attributes
- protected
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def plus(x: Either[E, O], y: Either[E, O]): Either[E, O]
- Definition Classes
- EventuallySemigroup → AdditiveSemigroup
- def positiveSumN(a: Either[E, O], n: Int): Either[E, O]
- Attributes
- protected[this]
- Definition Classes
- AdditiveSemigroup
- def repeatedCombineN(a: Either[E, O], n: Int): Either[E, O]
- Attributes
- protected[this]
- Definition Classes
- Semigroup
- def sumN(a: Either[E, O], n: Int): Either[E, O]
- Definition Classes
- AdditiveSemigroup
- def sumOption(iter: TraversableOnce[Either[E, O]]): Option[Either[E, O]]
Returns an instance of
T
calculated by summing all instances initer
in one pass.Returns an instance of
T
calculated by summing all instances initer
in one pass. ReturnsNone
ifiter
is empty, elseSome[ T]
.- iter
instances of
T
to be combined- returns
None
ifiter
is empty, else an option value containing the summedT
- Definition Classes
- EventuallySemigroup → Semigroup
- Note
Override if there is a faster way to compute this sum than
iter.reduceLeftOption
using plus.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def trySum(iter: TraversableOnce[Either[E, O]]): Option[Either[E, O]]
- Definition Classes
- Semigroup → AdditiveSemigroup
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()