Skip to content

Commit

Permalink
Tweak EitherT.pure and rightT to avoid a map call (#3408)
Browse files Browse the repository at this point in the history
It's not necessary.
  • Loading branch information
joroKr21 authored May 7, 2020
1 parent 8cb9df6 commit 614cd71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/data/EitherT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ object EitherT extends EitherTInstances {
* Uses the [[http://typelevel.org/cats/guidelines.html#partially-applied-type-params Partially Applied Type Params technique]] for ergonomics.
*/
final private[data] class PurePartiallyApplied[F[_], A](private val dummy: Boolean = true) extends AnyVal {
def apply[B](b: B)(implicit F: Applicative[F]): EitherT[F, A, B] = right(F.pure(b))
def apply[B](b: B)(implicit F: Applicative[F]): EitherT[F, A, B] = EitherT(F.pure(Right(b)))
}

/**
Expand Down

0 comments on commit 614cd71

Please sign in to comment.