I am learning scala and would like to understand how Futures could be implemented for a curried functions
import scala.concurrent.{Await, Future}
import scala.concurrent.duration.Duration
import scala.concurrent.ExecutionContext.Implicits.global
object MainApp {
def main(args: Array[String]): Unit = {
val x = curriedMultiply(10) _ andThen Await.result(curriedAdd(10),Duration.Inf)
println(x(2))
}
def curriedAdd(x: Int)(y: Int) : Future[Int]= Future {
x + y
}
def curriedMultiply(x: Int)(y: Int) : Future[Int] = Future {
x * y
}
}
I am getting the below compiler error when getting the value
Type mismatch, expected: Awaitable[NotInferedT], actual: Int => Future[Int]