Skip to content

Commit

Permalink
Merge pull request #3183 from travisbrown/topic/redundant-object-final
Browse files Browse the repository at this point in the history
Remove redundant final modifiers on objects
  • Loading branch information
travisbrown authored Dec 3, 2019
2 parents 8253462 + 5934f4f commit 31b82ba
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/data/Chain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ object Chain extends ChainInstances {

private val sentinel: Function1[Any, Any] = new scala.runtime.AbstractFunction1[Any, Any] { def apply(a: Any) = this }

final private[data] case object Empty extends Chain[Nothing] {
private[data] case object Empty extends Chain[Nothing] {
def isEmpty: Boolean = true
}
final private[data] case class Singleton[A](a: A) extends Chain[A] {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/tut/datatypes/chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ In code it looks like this:
```tut:book
sealed abstract class Chain[+A]
final case object Empty extends Chain[Nothing]
case object Empty extends Chain[Nothing]
final case class Singleton[A](a: A) extends Chain[A]
final case class Append[A](left: Chain[A], right: Chain[A]) extends Chain[A]
final case class Wrap[A](seq: Seq[A]) extends Chain[A]
Expand Down
10 changes: 5 additions & 5 deletions docs/src/main/tut/datatypes/either.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ can go wrong in our program.
object EitherStyle {
sealed abstract class Error
final case class NotANumber(string: String) extends Error
final case object NoZeroReciprocal extends Error
case object NoZeroReciprocal extends Error
def parse(s: String): Either[Error, Int] =
if (s.matches("-?[0-9]+")) Either.right(s.toInt)
Expand Down Expand Up @@ -261,10 +261,10 @@ We may then be tempted to make our entire application share an error data type.

```tut:silent
sealed abstract class AppError
final case object DatabaseError1 extends AppError
final case object DatabaseError2 extends AppError
final case object ServiceError1 extends AppError
final case object ServiceError2 extends AppError
case object DatabaseError1 extends AppError
case object DatabaseError2 extends AppError
case object ServiceError1 extends AppError
case object ServiceError2 extends AppError
trait DatabaseValue
Expand Down
6 changes: 3 additions & 3 deletions kernel/src/main/scala/cats/kernel/Comparison.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ package cats.kernel
sealed abstract class Comparison(val toInt: Int, val toDouble: Double) extends Product with Serializable

object Comparison {
final case object GreaterThan extends Comparison(1, 1.0)
final case object EqualTo extends Comparison(0, 0.0)
final case object LessThan extends Comparison(-1, -1.0)
case object GreaterThan extends Comparison(1, 1.0)
case object EqualTo extends Comparison(0, 0.0)
case object LessThan extends Comparison(-1, -1.0)

// Used for fromDouble
private val SomeGt = Some(Comparison.GreaterThan)
Expand Down

0 comments on commit 31b82ba

Please sign in to comment.