Skip to content

Commit

Permalink
Minor clean up (typelevel#3135)
Browse files Browse the repository at this point in the history
  • Loading branch information
Filippo Mariotti authored and travisbrown committed Nov 13, 2019
1 parent d0f3a87 commit aa3427d
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions core/src/main/scala/cats/instances/parallel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,10 @@ package instances

import cats.data._
import cats.kernel.Semigroup
import cats.syntax.either._
import cats.{~>, Applicative, Monad, Parallel}

private[instances] trait ParallelInstances1 {
@deprecated("Use EitherT.catsDataParallelForEitherTWithSequentialEffect", "2.0.0")
def catsParallelForEitherTNestedValidated[M[_]: Monad, E: Semigroup]
: Parallel.Aux[EitherT[M, E, *], Nested[M, Validated[E, *], *]] =
new Parallel[EitherT[M, E, *]] {
type F[x] = Nested[M, Validated[E, *], x]

implicit val appValidated: Applicative[Validated[E, *]] = Validated.catsDataApplicativeErrorForValidated
implicit val monadEither: Monad[Either[E, *]] = cats.instances.either.catsStdInstancesForEither

def applicative: Applicative[Nested[M, Validated[E, *], *]] =
cats.data.Nested.catsDataApplicativeForNested[M, Validated[E, *]]

def monad: Monad[EitherT[M, E, *]] = cats.data.EitherT.catsDataMonadErrorForEitherT

def sequential: Nested[M, Validated[E, *], *] ~> EitherT[M, E, *] =
λ[Nested[M, Validated[E, *], *] ~> EitherT[M, E, *]] { nested =>
EitherT(Monad[M].map(nested.value)(_.toEither))
}

def parallel: EitherT[M, E, *] ~> Nested[M, Validated[E, *], *] =
λ[EitherT[M, E, *] ~> Nested[M, Validated[E, *], *]] { eitherT =>
Nested(Monad[M].map(eitherT.value)(_.toValidated))
}
}
EitherT.catsDataParallelForEitherTWithSequentialEffect
}

0 comments on commit aa3427d

Please sign in to comment.