let rec pi f = function
  | [] -> 1
  | x :: rest -> f x * pi f rest;;