From e217be185891b67259c6c685cc134b6bfc95cc06 Mon Sep 17 00:00:00 2001 From: Kevin Lee Date: Mon, 12 Feb 2024 23:03:35 +1100 Subject: [PATCH] Clean up: Remove unused code --- .../scala/just/fp/syntax/EqualSyntax.scala | 20 +++++++++---------- core/src/test/scala/just/fp/MonoidSpec.scala | 4 ++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/core/src/main/scala/just/fp/syntax/EqualSyntax.scala b/core/src/main/scala/just/fp/syntax/EqualSyntax.scala index ff77bc4..8106f29 100644 --- a/core/src/main/scala/just/fp/syntax/EqualSyntax.scala +++ b/core/src/main/scala/just/fp/syntax/EqualSyntax.scala @@ -2,23 +2,21 @@ package just.fp.syntax import just.fp.Equal -/** - * @author Kevin Lee +/** @author Kevin Lee * @since 2019-07-28 */ + +trait EqualSyntax { + import EqualSyntax._ + + implicit def ToEqualOps[A](eqLeft: A): EqualOps[A] = + new EqualOps(eqLeft) +} object EqualSyntax { - final class EqualOps[A] private[syntax] (val eqLeft: A) extends AnyVal { + final class EqualOps[A] private[syntax] (private val eqLeft: A) extends AnyVal { def ===(eqRight: A)(implicit E: Equal[A]): Boolean = E.equal(eqLeft, eqRight) def !==(eqRight: A)(implicit E: Equal[A]): Boolean = !E.equal(eqLeft, eqRight) } } - -@SuppressWarnings(Array("org.wartremover.warts.ImplicitConversion")) -trait EqualSyntax { - import EqualSyntax._ - - implicit def ToEqualOps[A: Equal](eqLeft: A): EqualOps[A] = - new EqualOps(eqLeft) -} diff --git a/core/src/test/scala/just/fp/MonoidSpec.scala b/core/src/test/scala/just/fp/MonoidSpec.scala index b853e5c..aa23547 100644 --- a/core/src/test/scala/just/fp/MonoidSpec.scala +++ b/core/src/test/scala/just/fp/MonoidSpec.scala @@ -211,11 +211,11 @@ object MonoidSpec extends Properties { ) ) - def testMonoidFunction[A : Monoid : Equal](name: String, monoid: A)(f: (Monoid[A], A) => Boolean): Result = { + def testMonoidFunction[A : Monoid](name: String, monoid: A)(f: (Monoid[A], A) => Boolean): Result = { Result.diffNamed(s"=== $name Not true ===", Monoid[A], monoid)(f) } - def propertyTestMonoidFunction[A : Monoid : Equal](name: String, genA: Gen[A])(f: (Monoid[A], A) => Boolean): Property = for { + def propertyTestMonoidFunction[A : Monoid](name: String, genA: Gen[A])(f: (Monoid[A], A) => Boolean): Property = for { monoid <- genA.log("monoid") } yield { Result.diffNamed(s"=== $name Not false ===", Monoid[A], monoid)(f)