Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions kernel/shared/src/main/scala/cats/effect/kernel/GenSpawn.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package cats.effect.kernel

import cats.{~>, Applicative, Monoid, Semigroup}
import cats.{Applicative, Monoid, Semigroup}
import cats.data.{EitherT, Ior, IorT, Kleisli, OptionT, WriterT}
import cats.effect.kernel.syntax.monadCancel._
import cats.syntax.all._
Expand Down Expand Up @@ -851,12 +851,11 @@ object GenSpawn {
}

private def liftOutcome[A](oc: Outcome[F, E, A]): Outcome[Kleisli[F, R, *], E, A] = {

val nat: F ~> Kleisli[F, R, *] = new ~>[F, Kleisli[F, R, *]] {
def apply[B](fa: F[B]) = Kleisli.liftF(fa)
oc match {
case Outcome.Canceled() => Outcome.Canceled()
case Outcome.Errored(e) => Outcome.Errored(e)
case Outcome.Succeeded(fa) => Outcome.Succeeded(Kleisli.liftF(fa))
}

oc.mapK(nat)
}

private def liftFiber[A](fib: Fiber[F, E, A]): Fiber[Kleisli[F, R, *], E, A] =
Expand Down
Loading