-
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Would LiftIO instances for Future and Rerunnable be welcomed? I couldn't find laws for LiftIO but these rough implementations seemed to work after some limited testing I did.
implicit val rerunnableLiftIO: LiftIO[Rerunnable] = new LiftIO[Rerunnable] {
override def liftIO[A](ioa: IO[A]): Rerunnable[A] =
Rerunnable.fromFuture(LiftIO[Future].liftIO(ioa))
}
implicit val futureLiftIO: LiftIO[Future] = new LiftIO[Future] {
override def liftIO[A](ioa: IO[A]): Future[A] = {
val p = Promise[A]
ioa.unsafeRunAsync {
case Left(ex) => p.setException(ex)
case Right(a) => p.setValue(a)
}
p
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels