Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scalafmt to v3.5.2 #1063

Merged
merged 2 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=3.3.1
version=3.5.2
runner.dialect = scala212
fileOverride {
"glob:**/scala-2.13*/**" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,15 +552,15 @@ object CMS {
* and thus the returned frequency estimates are always instances of `Approximate[Long]`.
*
* @example
* {{{
* {{{
*
* // Creates a monoid for a CMS that can count `Long` elements. val cmsMonoid: CMSMonoid[Long] = { val eps =
* 0.001 val delta = 1E-10 val seed = 1 CMS.monoid[Long](eps, delta, seed) }
*
* // Creates a CMS instance that has counted the element `1L`. val cms: CMS[Long] = cmsMonoid.create(1L)
*
* // Estimates the frequency of `1L` val estimate: Approximate[Long] = cms.frequency(1L)
* }}}
* }}}
*
* @tparam K
* The type used to identify the elements to be counted.
Expand Down
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 @@ -238,7 +238,7 @@ object Fold extends CompatFold {

/**
* A Fold that does no work and returns a constant. Analogous to Function1 const: def const[A, B](b: B): (A
* => B) = { _ => b }
* \=> B) = { _ => b }
*/
def const[O](value: O): Fold[Any, O] =
Fold.foldLeft(value) { case (u, _) => u }
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import Operators._
* Example usage:
*
* case class W28[T](window: Window[T]) { def total = this.window.total def items = this.window.items def size
* = this.window.size }
* \= this.window.size }
*
* object W28 { val windowSize = 28 def apply[T](v: T): W28[T] = W28[T](Window(v))
*
Expand Down