Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
regadas committed Apr 27, 2022
1 parent fbab012 commit 8a93441
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
17 changes: 12 additions & 5 deletions algebird-core/src/main/scala/com/twitter/algebird/Eventually.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ import scala.collection.compat._
* 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) = Left(x+convert(y)) Right(x) + Left(y) = Left(convert(x)+y) Right(x) +
* 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.
* - 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) = Left(x+convert(y))
* Right(x) + Left(y) = Left(convert(x)+y)
* Right(x) + 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.
*
* @param E
* eventual type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ limitations under the License.
package com.twitter.algebird

/**
* Used to represent cases where we need to periodically reset a + b = a + b
* \|a + b = |(a + b) a + |b = |b
* \|a + |b = |b
* Used to represent cases where we need to periodically reset
* {{{
* a + b = a + b
* |a + b = |(a + b)
* a + |b = |b
* |a + |b = |b
* }}}
*/
sealed trait ResetState[+A] { def get: A }
case class SetValue[+A](override val get: A) extends ResetState[A]
Expand Down

0 comments on commit 8a93441

Please sign in to comment.