如何将scalaz.EitherT.from应用于scalaz.\/?

如何将scalaz.EitherT.from应用于scalaz.\/?,scala,monads,scalaz,monad-transformers,Scala,Monads,Scalaz,Monad Transformers,我正试图从中调整我的代码。一切都很好,除了我的方法返回scalaz.\/而不是scala.util.or。所以现在我必须写一个类似这样的猴子代码: def myFunction:Future[LeftBad \/ RightGood] = ... val result = for { x <- fromEither(myFunction.map(_.toEither)) } yield { ... } result.run //etc def myFunction:Futu

我正试图从中调整我的代码。一切都很好,除了我的方法返回
scalaz.\/
而不是
scala.util.or
。所以现在我必须写一个类似这样的猴子代码:

def myFunction:Future[LeftBad \/ RightGood] = ...

val result = for {
    x <- fromEither(myFunction.map(_.toEither))
} yield {
  ...
}
result.run
//etc
def myFunction:Future[LeftBad\/RightGood]=。。。
val结果=用于{
x您可以使用或仅使用:


这两种变体都可以工作,但在
EitherT(…)
intellij idea无法表示类型。:(但代码在sbt构建之后工作。)
import scalaz._, Scalaz._

val futDisjunction: Future[String \/ Int] = Future.successful(\/-(5))

scala> EitherT(futDisjunction)
// scalaz.EitherT[scala.concurrent.Future,String,Int]