Skip to content

Commit

Permalink
Manual fix-up for anywhere A is already used
Browse files Browse the repository at this point in the history
  • Loading branch information
travisbrown committed Dec 4, 2019
1 parent c7f1913 commit 0b415ed
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
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 @@ -674,7 +674,7 @@ object EitherT extends EitherTInstances {
* }}}
*/
final def liftK[F[_], A](implicit F: Functor[F]): F ~> EitherT[F, A, *] =
new (F ~> EitherT[F, A, *]) { def apply[A](a: F[A]): EitherT[F, A, A] = right(a) }
new (F ~> EitherT[F, A, *]) { def apply[B](fb: F[B]): EitherT[F, A, B] = right(fb) }

@deprecated("Use EitherT.liftF.", "1.0.0-RC1")
final def liftT[F[_], A, B](fb: F[B])(implicit F: Functor[F]): EitherT[F, A, B] = right(fb)
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/scala/cats/data/Kleisli.scala
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ object Kleisli
* }}}
*/
def applyK[F[_], A](a: A): Kleisli[F, A, *] ~> F =
new (Kleisli[F, A, *] ~> F) { def apply[A](a: Kleisli[F, A, A]): F[A] = a.apply(a) }
new (Kleisli[F, A, *] ~> F) { def apply[B](k: Kleisli[F, A, B]): F[B] = k.apply(a) }

}

Expand Down Expand Up @@ -204,7 +204,7 @@ sealed private[data] trait KleisliFunctions {
* }}}
*/
def liftK[F[_], A]: F ~> Kleisli[F, A, *] =
new (F ~> Kleisli[F, A, *]) { def apply[A](a: F[A]): Kleisli[F, A, A] = Kleisli.liftF(a) }
new (F ~> Kleisli[F, A, *]) { def apply[B](fb: F[B]): Kleisli[F, A, B] = Kleisli.liftF(fb) }

@deprecated("Use liftF instead", "1.0.0-RC2")
private[cats] def lift[F[_], A, B](x: F[B]): Kleisli[F, A, B] =
Expand Down Expand Up @@ -268,7 +268,7 @@ sealed private[data] trait KleisliFunctionsBinCompat {
* }}}
* */
def liftFunctionK[F[_], G[_], A](f: F ~> G): Kleisli[F, A, *] ~> Kleisli[G, A, *] =
new (Kleisli[F, A, *] ~> Kleisli[G, A, *]) { def apply[A](a: Kleisli[F, A, A]): Kleisli[G, A, A] = a.mapK(f) }
new (Kleisli[F, A, *] ~> Kleisli[G, A, *]) { def apply[B](k: Kleisli[F, A, B]): Kleisli[G, A, B] = k.mapK(f) }
}

sealed private[data] trait KleisliExplicitInstances {
Expand Down Expand Up @@ -375,12 +375,12 @@ sealed abstract private[data] class KleisliInstances1 extends KleisliInstances2

def sequential: Kleisli[P.F, A, *] ~> Kleisli[M, A, *] =
new (Kleisli[P.F, A, *] ~> Kleisli[M, A, *]) {
def apply[A](a: Kleisli[P.F, A, A]): Kleisli[M, A, A] = a.mapK(P.sequential)
def apply[B](k: Kleisli[P.F, A, B]): Kleisli[M, A, B] = k.mapK(P.sequential)
}

def parallel: Kleisli[M, A, *] ~> Kleisli[P.F, A, *] =
new (Kleisli[M, A, *] ~> Kleisli[P.F, A, *]) {
def apply[A](a: Kleisli[M, A, A]): Kleisli[P.F, A, A] = a.mapK(P.parallel)
def apply[B](k: Kleisli[M, A, B]): Kleisli[P.F, A, B] = k.mapK(P.parallel)
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/data/NonEmptyList.scala
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,11 @@ sealed abstract private[data] class NonEmptyListInstances extends NonEmptyListIn
def apply: Apply[ZipNonEmptyList] = ZipNonEmptyList.catsDataCommutativeApplyForZipNonEmptyList

def sequential: ZipNonEmptyList ~> NonEmptyList =
new (ZipNonEmptyList ~> NonEmptyList) { def apply[A](a: ZipNonEmptyList[A]): NonEmptyList[A] = a.value }
new (ZipNonEmptyList ~> NonEmptyList) { def apply[B](nel: ZipNonEmptyList[B]): NonEmptyList[B] = nel.value }

def parallel: NonEmptyList ~> ZipNonEmptyList =
new (NonEmptyList ~> ZipNonEmptyList) {
def apply[A](nel: NonEmptyList[A]): ZipNonEmptyList[A] = new ZipNonEmptyList(nel)
def apply[B](nel: NonEmptyList[B]): ZipNonEmptyList[B] = new ZipNonEmptyList(nel)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/data/OneAnd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ sealed abstract private[data] class OneAndInstances extends OneAndLowPriority0 {

def sequential: OneAnd[F0, *] ~> OneAnd[M, *] =
new (OneAnd[F0, *] ~> OneAnd[M, *]) {
def apply[A](ofa: OneAnd[F0, A]): OneAnd[M, A] = OneAnd(ofa.head, P.sequential(ofa.tail))
def apply[B](ofb: OneAnd[F0, B]): OneAnd[M, B] = OneAnd(ofb.head, P.sequential(ofb.tail))
}

def parallel: OneAnd[M, *] ~> OneAnd[F0, *] =
new (OneAnd[M, *] ~> OneAnd[F0, *]) {
def apply[A](ofa: OneAnd[M, A]): OneAnd[F0, A] = OneAnd(ofa.head, P.parallel(ofa.tail))
def apply[B](ofb: OneAnd[M, B]): OneAnd[F0, B] = OneAnd(ofb.head, P.parallel(ofb.tail))
}

}
Expand Down

0 comments on commit 0b415ed

Please sign in to comment.