(* * This is an implementation of product in F#. * It's kind of ugly, though. Compare with the * pattern-matching version in product2.fs * * @param nums A list of numbers. * @returns The result of multiplying all numbers in nums. *) let rec product nums = // base case if nums = [] then 1 // recursive case: multiply the head element with // the rest of the list else (List.head nums) * product (List.tail nums) // call product like this product [1; 2; 3]