我找不到最常用的方式来将EitherT[Future, Throwable, A]折叠到Future[A],其中Either的左侧将表示为失败的Future。
发布于 2017-08-29 15:54:45
简单直接的折叠不好吗?
foo.fold(Future.failed, Future.successful).flatten发布于 2017-09-28 04:01:45
您可以使用fold并抛出您在左侧找到的任何Throwable
val foo: EitherT[Future, Throwable, A] = ???
import cats.instances.future._
foo.fold(throw _, identity)https://stackoverflow.com/questions/45920610
复制相似问题