Skip to content

Commit

Permalink
use SAM conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Dec 31, 2022
1 parent b994e81 commit 5ed75a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
10 changes: 2 additions & 8 deletions jvm/src/test/scala/org/atnos/eff/EffApplicativeSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,9 @@ class EffApplicativeSpec(implicit ee: ExecutionEnv) extends Specification with S

import OptionEffect._

implicit val eqEffInt: Eq[F[Int]] = new Eq[F[Int]] {
def eqv(x: F[Int], y: F[Int]): Boolean =
runOption(x).run == runOption(y).run
}
implicit val eqEffInt: Eq[F[Int]] = (x: F[Int], y: F[Int]) => runOption(x).run == runOption(y).run

implicit val eqEffInt3: Eq[F[(Int, Int, Int)]] = new Eq[F[(Int, Int, Int)]] {
def eqv(x: F[(Int, Int, Int)], y: F[(Int, Int, Int)]): Boolean =
runOption(x).run == runOption(y).run
}
implicit val eqEffInt3: Eq[F[(Int, Int, Int)]] = (x: F[(Int, Int, Int)], y: F[(Int, Int, Int)]) => runOption(x).run == runOption(y).run

implicit val scheduler: Scheduler =
ExecutorServices.schedulerFromGlobalExecutionContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ package object scalaz {
Eff.EffApplicative[R].ap(ff)(fa)
}

def catsSemigroup[A](s: Semigroup[A]): cats.Semigroup[A] = new cats.Semigroup[A] {
def combine(x: A, y: A): A = s.append(x, y)
}
def catsSemigroup[A](s: Semigroup[A]): cats.Semigroup[A] =
(x: A, y: A) => s.append(x, y)

}
12 changes: 4 additions & 8 deletions shared/src/test/scala/org/atnos/eff/EffSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,10 @@ class EffSpec extends Specification with ScalaCheck with ThrownExpectations with

import OptionEffect._

implicit val eqEffInt: Eq[F[Int]] = new Eq[F[Int]] {
def eqv(x: F[Int], y: F[Int]): Boolean =
runOption(x).run == runOption(y).run
}
implicit val eqEffInt: Eq[F[Int]] =
(x: F[Int], y: F[Int]) => runOption(x).run == runOption(y).run

implicit val eqEffInt3: Eq[F[(Int, Int, Int)]] = new Eq[F[(Int, Int, Int)]] {
def eqv(x: F[(Int, Int, Int)], y: F[(Int, Int, Int)]): Boolean =
runOption(x).run == runOption(y).run
}
implicit val eqEffInt3: Eq[F[(Int, Int, Int)]] =
(x: F[(Int, Int, Int)], y: F[(Int, Int, Int)]) => runOption(x).run == runOption(y).run

}

0 comments on commit 5ed75a8

Please sign in to comment.