Guest User

Untitled

a guest
Nov 17th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import scalaz._
  2. import Scalaz._
  3.  
  4. import scala.concurrent._, duration._
  5.  
  6. import scala.concurrent.ExecutionContext.Implicits.global
  7.  
  8. object FooBar {
  9.  
  10. def main(args: Array[String]): Unit = {
  11.  
  12. def webServiceCall: Future[String / String] = Future(/-("Some data"))
  13.  
  14. def foo : String / String = /-("foo")
  15.  
  16. def getData(): EitherT[Future, String, String] = EitherT(webServiceCall)
  17.  
  18. def auth() = for {
  19. e1 <- getData()
  20. e2 <- EitherT.fromDisjunction(foo)
  21. } yield e1
  22.  
  23. println(Await.result(auth.run, 5.second))
  24. }
  25.  
  26. }
  27.  
  28. diverging implicit expansion for type scalaz.Monoid[A]
  29. [error] starting with value bigIntegerMultiplication in trait BigIntegerInstances
  30. [error] e2 <- EitherT.fromDisjunction(foo)
  31. [error] ^
  32. [error] one error found
  33. [error] (Compile / compileIncremental) Compilation failed
Add Comment
Please, Sign In to add comment