Skip to content

Commit

Permalink
make Order have more priority than Eq
Browse files Browse the repository at this point in the history
  • Loading branch information
pepegar committed Oct 19, 2016
1 parent f8462cd commit 4e9c489
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/main/scala/cats/data/Prod.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ private[data] sealed abstract class ProdInstances extends ProdInstances0 {
def G: Alternative[G] = GG
}

implicit def catsDataEqForProd[F[_], G[_], A](implicit FF: Eq[F[A]], GG: Eq[G[A]]): Eq[Prod[F, G, A]] = new Eq[Prod[F, G, A]] {
def eqv(x: Prod[F, G, A], y: Prod[F, G, A]): Boolean =
FF.eqv(x.first, y.first) && GG.eqv(x.second, y.second)
implicit def catsDataOrderForProd[F[_], G[_], A](implicit FF: Order[F[A]], GF: Order[G[A]]): Order[Prod[F, G, A]] = new ProdOrder[F, G, A] {
def F: Order[F[A]] = FF
def G: Order[G[A]] = GF
}

implicit def catsDataShowForProd[F[_], G[_], A](implicit FF: Show[F[A]], GF: Show[G[A]]): Show[Prod[F, G, A]] = new ProdShow[F, G, A] {
Expand All @@ -36,9 +36,9 @@ private[data] sealed abstract class ProdInstances0 extends ProdInstances1 {
def G: MonoidK[G] = GG
}

implicit def catsDataOrderForProd[F[_], G[_], A](implicit FF: Order[F[A]], GF: Order[G[A]]): Order[Prod[F, G, A]] = new ProdOrder[F, G, A] {
def F: Order[F[A]] = FF
def G: Order[G[A]] = GF
implicit def catsDataEqForProd[F[_], G[_], A](implicit FF: Eq[F[A]], GG: Eq[G[A]]): Eq[Prod[F, G, A]] = new Eq[Prod[F, G, A]] {
def eqv(x: Prod[F, G, A], y: Prod[F, G, A]): Boolean =
FF.eqv(x.first, y.first) && GG.eqv(x.second, y.second)
}
}

Expand Down

0 comments on commit 4e9c489

Please sign in to comment.