2017-08-28 58 views

回答

0

是一个简单的直线折叠不好吗?

foo.fold(Future.failed, Future.successful).flatten 
0

你可以使用fold扔你会发现无论Throwable左侧

val foo: EitherT[Future, Throwable, A] = ??? 

import cats.instances.future._ 

foo.fold(throw _, identity)