Skip to content

Commit

Permalink
Add Serializable with Simulacrum Scalafix
Browse files Browse the repository at this point in the history
  • Loading branch information
travisbrown committed May 29, 2020
1 parent 6779c3a commit 47c4679
Show file tree
Hide file tree
Showing 50 changed files with 100 additions and 100 deletions.
4 changes: 2 additions & 2 deletions alleycats-core/src/main/scala/alleycats/ConsK.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ object ConsK {
*/
@inline def apply[F[_]](implicit instance: ConsK[F]): ConsK[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: ConsK[F]
def self: F[A]
val typeClassInstance: TypeClassType
}
trait AllOps[F[_], A] extends Ops[F, A]
trait ToConsKOps {
trait ToConsKOps extends Serializable {
implicit def toConsKOps[F[_], A](target: F[A])(implicit tc: ConsK[F]): Ops[F, A] {
type TypeClassType = ConsK[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions alleycats-core/src/main/scala/alleycats/Empty.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ object Empty extends EmptyInstances0 {
*/
@inline def apply[A](implicit instance: Empty[A]): Empty[A] = instance

trait Ops[A] {
trait Ops[A] extends Serializable {
type TypeClassType <: Empty[A]
def self: A
val typeClassInstance: TypeClassType
def isEmpty(implicit ev: Eq[A]): Boolean = typeClassInstance.isEmpty(self)(ev)
def nonEmpty(implicit ev: Eq[A]): Boolean = typeClassInstance.nonEmpty(self)(ev)
}
trait AllOps[A] extends Ops[A]
trait ToEmptyOps {
trait ToEmptyOps extends Serializable {
implicit def toEmptyOps[A](target: A)(implicit tc: Empty[A]): Ops[A] {
type TypeClassType = Empty[A]
} = new Ops[A] {
Expand Down
4 changes: 2 additions & 2 deletions alleycats-core/src/main/scala/alleycats/EmptyK.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ object EmptyK {
*/
@inline def apply[F[_]](implicit instance: EmptyK[F]): EmptyK[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: EmptyK[F]
def self: F[A]
val typeClassInstance: TypeClassType
}
trait AllOps[F[_], A] extends Ops[F, A]
trait ToEmptyKOps {
trait ToEmptyKOps extends Serializable {
implicit def toEmptyKOps[F[_], A](target: F[A])(implicit tc: EmptyK[F]): Ops[F, A] {
type TypeClassType = EmptyK[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions alleycats-core/src/main/scala/alleycats/Extract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ object Extract {
*/
@inline def apply[F[_]](implicit instance: Extract[F]): Extract[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: Extract[F]
def self: F[A]
val typeClassInstance: TypeClassType
def extract: A = typeClassInstance.extract[A](self)
}
trait AllOps[F[_], A] extends Ops[F, A]
trait ToExtractOps {
trait ToExtractOps extends Serializable {
implicit def toExtractOps[F[_], A](target: F[A])(implicit tc: Extract[F]): Ops[F, A] {
type TypeClassType = Extract[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions alleycats-core/src/main/scala/alleycats/One.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ object One {
*/
@inline def apply[A](implicit instance: One[A]): One[A] = instance

trait Ops[A] {
trait Ops[A] extends Serializable {
type TypeClassType <: One[A]
def self: A
val typeClassInstance: TypeClassType
def isOne(implicit ev: Eq[A]): Boolean = typeClassInstance.isOne(self)(ev)
def nonOne(implicit ev: Eq[A]): Boolean = typeClassInstance.nonOne(self)(ev)
}
trait AllOps[A] extends Ops[A]
trait ToOneOps {
trait ToOneOps extends Serializable {
implicit def toOneOps[A](target: A)(implicit tc: One[A]): Ops[A] {
type TypeClassType = One[A]
} = new Ops[A] {
Expand Down
4 changes: 2 additions & 2 deletions alleycats-core/src/main/scala/alleycats/Pure.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ object Pure {
*/
@inline def apply[F[_]](implicit instance: Pure[F]): Pure[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: Pure[F]
def self: F[A]
val typeClassInstance: TypeClassType
}
trait AllOps[F[_], A] extends Ops[F, A]
trait ToPureOps {
trait ToPureOps extends Serializable {
implicit def toPureOps[F[_], A](target: F[A])(implicit tc: Pure[F]): Ops[F, A] {
type TypeClassType = Pure[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions alleycats-core/src/main/scala/alleycats/Zero.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ object Zero {
*/
@inline def apply[A](implicit instance: Zero[A]): Zero[A] = instance

trait Ops[A] {
trait Ops[A] extends Serializable {
type TypeClassType <: Zero[A]
def self: A
val typeClassInstance: TypeClassType
def isZero(implicit ev: Eq[A]): Boolean = typeClassInstance.isZero(self)(ev)
def nonZero(implicit ev: Eq[A]): Boolean = typeClassInstance.nonZero(self)(ev)
}
trait AllOps[A] extends Ops[A]
trait ToZeroOps {
trait ToZeroOps extends Serializable {
implicit def toZeroOps[A](target: A)(implicit tc: Zero[A]): Ops[A] {
type TypeClassType = Zero[A]
} = new Ops[A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Align.scala
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ object Align extends ScalaVersionSpecificAlignInstances {
*/
@inline def apply[F[_]](implicit instance: Align[F]): Align[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: Align[F]
def self: F[A]
val typeClassInstance: TypeClassType
Expand All @@ -150,7 +150,7 @@ object Align extends ScalaVersionSpecificAlignInstances {
def zipAll[B](fb: F[B], a: A, b: B): F[(A, B)] = typeClassInstance.zipAll[A, B](self, fb, a, b)
}
trait AllOps[F[_], A] extends Ops[F, A]
trait ToAlignOps {
trait ToAlignOps extends Serializable {
implicit def toAlignOps[F[_], A](target: F[A])(implicit tc: Align[F]): Ops[F, A] {
type TypeClassType = Align[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Alternative.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object Alternative {
*/
@inline def apply[F[_]](implicit instance: Alternative[F]): Alternative[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: Alternative[F]
def self: F[A]
val typeClassInstance: TypeClassType
Expand All @@ -114,7 +114,7 @@ object Alternative {
trait AllOps[F[_], A] extends Ops[F, A] with Applicative.AllOps[F, A] with MonoidK.AllOps[F, A] {
type TypeClassType <: Alternative[F]
}
trait ToAlternativeOps {
trait ToAlternativeOps extends Serializable {
implicit def toAlternativeOps[F[_], A](target: F[A])(implicit tc: Alternative[F]): Ops[F, A] {
type TypeClassType = Alternative[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Applicative.scala
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,15 @@ object Applicative {
*/
@inline def apply[F[_]](implicit instance: Applicative[F]): Applicative[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: Applicative[F]
def self: F[A]
val typeClassInstance: TypeClassType
}
trait AllOps[F[_], A] extends Ops[F, A] with Apply.AllOps[F, A] with InvariantMonoidal.AllOps[F, A] {
type TypeClassType <: Applicative[F]
}
trait ToApplicativeOps {
trait ToApplicativeOps extends Serializable {
implicit def toApplicativeOps[F[_], A](target: F[A])(implicit tc: Applicative[F]): Ops[F, A] {
type TypeClassType = Applicative[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Apply.scala
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ object Apply {
*/
@inline def apply[F[_]](implicit instance: Apply[F]): Apply[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: Apply[F]
def self: F[A]
val typeClassInstance: TypeClassType
Expand All @@ -294,7 +294,7 @@ object Apply {
trait AllOps[F[_], A] extends Ops[F, A] with Functor.AllOps[F, A] with InvariantSemigroupal.AllOps[F, A] {
type TypeClassType <: Apply[F]
}
trait ToApplyOps {
trait ToApplyOps extends Serializable {
implicit def toApplyOps[F[_], A](target: F[A])(implicit tc: Apply[F]): Ops[F, A] {
type TypeClassType = Apply[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Bifoldable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object Bifoldable {
*/
@inline def apply[F[_, _]](implicit instance: Bifoldable[F]): Bifoldable[F] = instance

trait Ops[F[_, _], A, B] {
trait Ops[F[_, _], A, B] extends Serializable {
type TypeClassType <: Bifoldable[F]
def self: F[A, B]
val typeClassInstance: TypeClassType
Expand All @@ -58,7 +58,7 @@ object Bifoldable {
def bifold(implicit A: Monoid[A], B: Monoid[B]): (A, B) = typeClassInstance.bifold[A, B](self)(A, B)
}
trait AllOps[F[_, _], A, B] extends Ops[F, A, B]
trait ToBifoldableOps {
trait ToBifoldableOps extends Serializable {
implicit def toBifoldableOps[F[_, _], A, B](target: F[A, B])(implicit tc: Bifoldable[F]): Ops[F, A, B] {
type TypeClassType = Bifoldable[F]
} = new Ops[F, A, B] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Bifunctor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ object Bifunctor {
*/
@inline def apply[F[_, _]](implicit instance: Bifunctor[F]): Bifunctor[F] = instance

trait Ops[F[_, _], A, B] {
trait Ops[F[_, _], A, B] extends Serializable {
type TypeClassType <: Bifunctor[F]
def self: F[A, B]
val typeClassInstance: TypeClassType
Expand All @@ -78,7 +78,7 @@ object Bifunctor {
def leftWiden[C >: A]: F[C, B] = typeClassInstance.leftWiden[A, B, C](self)
}
trait AllOps[F[_, _], A, B] extends Ops[F, A, B]
trait ToBifunctorOps {
trait ToBifunctorOps extends Serializable {
implicit def toBifunctorOps[F[_, _], A, B](target: F[A, B])(implicit tc: Bifunctor[F]): Ops[F, A, B] {
type TypeClassType = Bifunctor[F]
} = new Ops[F, A, B] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Bimonad.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ object Bimonad {
*/
@inline def apply[F[_]](implicit instance: Bimonad[F]): Bimonad[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: Bimonad[F]
def self: F[A]
val typeClassInstance: TypeClassType
}
trait AllOps[F[_], A] extends Ops[F, A] with Monad.AllOps[F, A] with Comonad.AllOps[F, A] {
type TypeClassType <: Bimonad[F]
}
trait ToBimonadOps {
trait ToBimonadOps extends Serializable {
implicit def toBimonadOps[F[_], A](target: F[A])(implicit tc: Bimonad[F]): Ops[F, A] {
type TypeClassType = Bimonad[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Bitraverse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ object Bitraverse {
*/
@inline def apply[F[_, _]](implicit instance: Bitraverse[F]): Bitraverse[F] = instance

trait Ops[F[_, _], A, B] {
trait Ops[F[_, _], A, B] extends Serializable {
type TypeClassType <: Bitraverse[F]
def self: F[A, B]
val typeClassInstance: TypeClassType
Expand All @@ -133,7 +133,7 @@ object Bitraverse {
trait AllOps[F[_, _], A, B] extends Ops[F, A, B] with Bifoldable.AllOps[F, A, B] with Bifunctor.AllOps[F, A, B] {
type TypeClassType <: Bitraverse[F]
}
trait ToBitraverseOps {
trait ToBitraverseOps extends Serializable {
implicit def toBitraverseOps[F[_, _], A, B](target: F[A, B])(implicit tc: Bitraverse[F]): Ops[F, A, B] {
type TypeClassType = Bitraverse[F]
} = new Ops[F, A, B] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/CoflatMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ object CoflatMap {
*/
@inline def apply[F[_]](implicit instance: CoflatMap[F]): CoflatMap[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: CoflatMap[F]
def self: F[A]
val typeClassInstance: TypeClassType
Expand All @@ -68,7 +68,7 @@ object CoflatMap {
trait AllOps[F[_], A] extends Ops[F, A] with Functor.AllOps[F, A] {
type TypeClassType <: CoflatMap[F]
}
trait ToCoflatMapOps {
trait ToCoflatMapOps extends Serializable {
implicit def toCoflatMapOps[F[_], A](target: F[A])(implicit tc: CoflatMap[F]): Ops[F, A] {
type TypeClassType = CoflatMap[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/CommutativeApplicative.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ object CommutativeApplicative {
*/
@inline def apply[F[_]](implicit instance: CommutativeApplicative[F]): CommutativeApplicative[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: CommutativeApplicative[F]
def self: F[A]
val typeClassInstance: TypeClassType
}
trait AllOps[F[_], A] extends Ops[F, A] with Applicative.AllOps[F, A] with CommutativeApply.AllOps[F, A] {
type TypeClassType <: CommutativeApplicative[F]
}
trait ToCommutativeApplicativeOps {
trait ToCommutativeApplicativeOps extends Serializable {
implicit def toCommutativeApplicativeOps[F[_], A](target: F[A])(implicit tc: CommutativeApplicative[F]): Ops[F, A] {
type TypeClassType = CommutativeApplicative[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/CommutativeApply.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ object CommutativeApply {
*/
@inline def apply[F[_]](implicit instance: CommutativeApply[F]): CommutativeApply[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: CommutativeApply[F]
def self: F[A]
val typeClassInstance: TypeClassType
}
trait AllOps[F[_], A] extends Ops[F, A] with Apply.AllOps[F, A] {
type TypeClassType <: CommutativeApply[F]
}
trait ToCommutativeApplyOps {
trait ToCommutativeApplyOps extends Serializable {
implicit def toCommutativeApplyOps[F[_], A](target: F[A])(implicit tc: CommutativeApply[F]): Ops[F, A] {
type TypeClassType = CommutativeApply[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/CommutativeFlatMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ object CommutativeFlatMap {
*/
@inline def apply[F[_]](implicit instance: CommutativeFlatMap[F]): CommutativeFlatMap[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: CommutativeFlatMap[F]
def self: F[A]
val typeClassInstance: TypeClassType
}
trait AllOps[F[_], A] extends Ops[F, A] with FlatMap.AllOps[F, A] with CommutativeApply.AllOps[F, A] {
type TypeClassType <: CommutativeFlatMap[F]
}
trait ToCommutativeFlatMapOps {
trait ToCommutativeFlatMapOps extends Serializable {
implicit def toCommutativeFlatMapOps[F[_], A](target: F[A])(implicit tc: CommutativeFlatMap[F]): Ops[F, A] {
type TypeClassType = CommutativeFlatMap[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/CommutativeMonad.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object CommutativeMonad {
*/
@inline def apply[F[_]](implicit instance: CommutativeMonad[F]): CommutativeMonad[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: CommutativeMonad[F]
def self: F[A]
val typeClassInstance: TypeClassType
Expand All @@ -37,7 +37,7 @@ object CommutativeMonad {
with CommutativeApplicative.AllOps[F, A] {
type TypeClassType <: CommutativeMonad[F]
}
trait ToCommutativeMonadOps {
trait ToCommutativeMonadOps extends Serializable {
implicit def toCommutativeMonadOps[F[_], A](target: F[A])(implicit tc: CommutativeMonad[F]): Ops[F, A] {
type TypeClassType = CommutativeMonad[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Comonad.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object Comonad {
*/
@inline def apply[F[_]](implicit instance: Comonad[F]): Comonad[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: Comonad[F]
def self: F[A]
val typeClassInstance: TypeClassType
Expand All @@ -49,7 +49,7 @@ object Comonad {
trait AllOps[F[_], A] extends Ops[F, A] with CoflatMap.AllOps[F, A] {
type TypeClassType <: Comonad[F]
}
trait ToComonadOps {
trait ToComonadOps extends Serializable {
implicit def toComonadOps[F[_], A](target: F[A])(implicit tc: Comonad[F]): Ops[F, A] {
type TypeClassType = Comonad[F]
} = new Ops[F, A] {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Contravariant.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object Contravariant {
*/
@inline def apply[F[_]](implicit instance: Contravariant[F]): Contravariant[F] = instance

trait Ops[F[_], A] {
trait Ops[F[_], A] extends Serializable {
type TypeClassType <: Contravariant[F]
def self: F[A]
val typeClassInstance: TypeClassType
Expand All @@ -51,7 +51,7 @@ object Contravariant {
trait AllOps[F[_], A] extends Ops[F, A] with Invariant.AllOps[F, A] {
type TypeClassType <: Contravariant[F]
}
trait ToContravariantOps {
trait ToContravariantOps extends Serializable {
implicit def toContravariantOps[F[_], A](target: F[A])(implicit tc: Contravariant[F]): Ops[F, A] {
type TypeClassType = Contravariant[F]
} = new Ops[F, A] {
Expand Down
Loading

0 comments on commit 47c4679

Please sign in to comment.