Skip to content

Commit

Permalink
updated to Algebra 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kailuowang committed Apr 24, 2016
1 parent d8917df commit 654257a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ lazy val commonSettings = Seq(
),
libraryDependencies ++= Seq(
"com.github.mpilquist" %%% "simulacrum" % "0.7.0",
"org.spire-math" %%% "algebra" % "0.3.1",
"org.spire-math" %%% "algebra-std" % "0.3.1",
"org.spire-math" %%% "algebra" % "0.4.0",
"org.spire-math" %%% "algebra-std" % "0.4.0",
"org.typelevel" %%% "machinist" % "0.4.1",
compilerPlugin("org.scalamacros" %% "paradise" % "2.1.0" cross CrossVersion.full),
compilerPlugin("org.spire-math" %% "kind-projector" % "0.6.3")
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/scala/cats/data/WriterT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ private[data] sealed abstract class WriterTInstances extends WriterTInstances0 {
implicit def writerTIdMonad[L:Monoid]: Monad[WriterT[Id, L, ?]] =
writerTMonadWriter[Id, L]

// The Eq[(L, V)] can be derived from an Eq[L] and Eq[V], but we are waiting
// on an algebra release that includes /~https://github.com/non/algebra/pull/82
implicit def writerTIdEq[L, V](implicit E: Eq[(L, V)]): Eq[WriterT[Id, L, V]] =
writerTEq[Id, L, V]

Expand Down
13 changes: 3 additions & 10 deletions laws/src/main/scala/cats/laws/discipline/Eq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package discipline

import catalysts.Platform
import algebra.Eq
import algebra.std.tuple
import cats.std.string._
import org.scalacheck.Arbitrary

Expand Down Expand Up @@ -31,17 +32,9 @@ object eq {
(a: A) => showInstance.show(a)
}

// Temporary, see /~https://github.com/non/algebra/pull/82
implicit def tuple2Eq[A, B](implicit A: Eq[A], B: Eq[B]): Eq[(A, B)] =
new Eq[(A, B)] {
def eqv(x: (A, B), y: (A, B)): Boolean =
A.eqv(x._1, y._1) && B.eqv(x._2, y._2)
}
implicit def tuple2Eq[A, B](implicit A: Eq[A], B: Eq[B]): Eq[(A, B)] = tuple.tuple2Eq

implicit def tuple3Eq[A, B, C](implicit EqA: Eq[A], EqB: Eq[B], EqC: Eq[C]): Eq[(A, B, C)] =
new Eq[(A, B, C)] {
def eqv(x: (A, B, C), y: (A, B, C)): Boolean = EqA.eqv(x._1, y._1) && EqB.eqv(x._2, y._2) && EqC.eqv(x._3, y._3)
}
implicit def tuple3Eq[A, B, C](implicit EqA: Eq[A], EqB: Eq[B], EqC: Eq[C]): Eq[(A, B, C)] = tuple.tuple3Eq

/**
* Create an approximation of Eq[Semigroup[A]] by generating values for A
Expand Down

0 comments on commit 654257a

Please sign in to comment.