(* * This is another implementation of product in F#. * We use pattern matching to select the correct * implementation depending on the value of nums. * Since we've more clearly defined the function * by cases, it is easier to read. * * @param nums A list of numbers. * @returns The result of multiplying all numbers in nums. *) let rec product nums = match nums with | [] -> 1 | x::xs -> x * product xs // call product like this product [1; 2; 3]