Calculating the “product” of a List[Int] recursively Calculating the product of a List[Int] is very similar to calculating the sum; you just multiply the values inside the function, and return 1 in the Nil case. Therefore I’ll just show the following code without discussing it: package recursion import scala.annotation.tailrec /** * Different ways to calculate the product of a List[Int] recursion.