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