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

MonadError instance for Ior #1548

Merged
merged 13 commits into from
Apr 9, 2017
3 changes: 1 addition & 2 deletions core/src/main/scala/cats/data/Validated.scala
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ private[data] sealed abstract class ValidatedInstances extends ValidatedInstance
fab.leftMap(f)
}

// scalastyle:off method.length
implicit def catsDataApplicativeErrorForValidated[E](implicit E: Semigroup[E]): ApplicativeError[Validated[E, ?], E] =
new ApplicativeError[Validated[E, ?], E] {

Expand All @@ -322,7 +321,6 @@ private[data] sealed abstract class ValidatedInstances extends ValidatedInstance
}
def raiseError[A](e: E): Validated[E, A] = Validated.Invalid(e)
}
// scalastyle:on method.length
}

private[data] sealed abstract class ValidatedInstances1 extends ValidatedInstances2 {
Expand Down Expand Up @@ -393,6 +391,7 @@ private[data] sealed abstract class ValidatedInstances2 {

override def isEmpty[A](fa: Validated[E, A]): Boolean = fa.isInvalid
}
// scalastyle:off method.length
}

private[data] trait ValidatedFunctions {
Expand Down
4 changes: 2 additions & 2 deletions tests/src/test/scala/cats/tests/IorTests.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cats
package tests

import cats.data.{EitherT, Ior}
import cats.kernel.laws.GroupLaws
import cats.laws.discipline.{BifunctorTests, CartesianTests, MonadErrorTests, SerializableTests, TraverseTests}
import cats.data.{Ior, NonEmptyList, EitherT}
import cats.kernel.laws.GroupLaws
Copy link
Collaborator

Choose a reason for hiding this comment

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

You had this import already on line 4 it seems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@peterneyens darn it. That one must have slipped when I merged. I'm on it.

import cats.laws.discipline.arbitrary._
import cats.laws.discipline.{BifunctorTests, CartesianTests, MonadTests, SerializableTests, TraverseTests}
import org.scalacheck.Arbitrary._

class IorTests extends CatsSuite {
Expand Down