Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move instances into separate trait #1659

Merged
merged 4 commits into from
May 28, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions tests/src/test/scala/cats/tests/EqTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cats
package tests

import org.scalatest._

import cats.functor._

class EqTests extends FunSuite {
{
import cats.implicits._
implicitly[Invariant[Eq]]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just nitpicking, but we don't need implicitly in all these tests as simulacrum generates an apply in the companion object. Should we just write Invariant[Eq], Invariant[Monoid], ...?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

implicitly[Contravariant[Eq]]
implicitly[Cartesian[Eq]]
implicitly[ContravariantCartesian[Eq]]
}

{
import cats.instances.eq._
implicitly[Invariant[Eq]]
implicitly[Contravariant[Eq]]
implicitly[Cartesian[Eq]]
implicitly[ContravariantCartesian[Eq]]
}
}
22 changes: 22 additions & 0 deletions tests/src/test/scala/cats/tests/MonoidTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cats
package tests

import org.scalatest._

import cats.functor._

class MonoidTests extends FunSuite {
{
import cats.implicits._
implicitly[Invariant[Monoid]]
implicitly[Cartesian[Monoid]]
implicitly[InvariantMonoidal[Monoid]]
}

{
import cats.instances.monoid._
implicitly[Invariant[Monoid]]
implicitly[Cartesian[Monoid]]
implicitly[InvariantMonoidal[Monoid]]
}
}
20 changes: 20 additions & 0 deletions tests/src/test/scala/cats/tests/OrderTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cats
package tests

import cats.functor._

import org.scalatest._

class OrderTests extends FunSuite {
{
import cats.implicits._
implicitly[Invariant[Order]]
implicitly[Contravariant[Order]]
}

{
import cats.instances.order._
implicitly[Invariant[Order]]
implicitly[Contravariant[Order]]
}
}
20 changes: 20 additions & 0 deletions tests/src/test/scala/cats/tests/PartialOrderTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cats
package tests

import org.scalatest._

import cats.functor._

class PartialOrderTests extends FunSuite {
{
import cats.implicits._
implicitly[Invariant[PartialOrder]]
implicitly[Contravariant[PartialOrder]]
}

{
import cats.instances.partialOrder._
implicitly[Invariant[PartialOrder]]
implicitly[Contravariant[PartialOrder]]
}
}
22 changes: 22 additions & 0 deletions tests/src/test/scala/cats/tests/SemigroupTests.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cats
package tests

import org.scalatest._

import cats.functor._

class SemigroupTests extends FunSuite {
{
import cats.implicits._
implicitly[Invariant[Semigroup]]
implicitly[Cartesian[Semigroup]]
implicitly[InvariantMonoidal[Semigroup]]
}

{
import cats.instances.semigroup._
implicitly[Invariant[Semigroup]]
implicitly[Cartesian[Semigroup]]
implicitly[InvariantMonoidal[Semigroup]]
}
}