In my Scala app, I have a function that calls a function which returns a result of type Future[T]. I need to pass the mapped result in my recursive function call. I want t
How about using foldLeft instead?
def factorial(n: Int): Future[Int] = future { (1 to n).foldLeft(1) { _ * _ } }