Skip to content

Commit

Permalink
Add guard for cyclomatic.complexity in parallel Ior instance
Browse files Browse the repository at this point in the history
  • Loading branch information
andyscott committed Dec 1, 2017
1 parent d4f7d01 commit 6d9a2b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/scala/cats/data/Ior.scala
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ private[data] sealed abstract class IorInstances extends IorInstances0 {

val applicative: Applicative[Ior[E, ?]] = new Applicative[Ior[E, ?]] {
def pure[A](a: A): Ior[E, A] = Ior.right(a)

// scalastyle:off cyclomatic.complexity
def ap[A, B](ff: Ior[E, A => B])(fa: Ior[E, A]): Ior[E, B] =
fa match {
case Ior.Right(a) => ff match {
Expand All @@ -234,7 +236,9 @@ private[data] sealed abstract class IorInstances extends IorInstances0 {
case Ior.Left(e2) => Ior.Left(E.combine(e2, e1))
}
}
// scalastyle:on cyclomatic.complexity
}

lazy val monad: Monad[Ior[E, ?]] = Monad[Ior[E, ?]]
}

Expand Down

0 comments on commit 6d9a2b8

Please sign in to comment.