Ocaml Quiz
Wednesday, October 25th, 2006
Quick, an Ocaml quiz: What is the best way to write a summation function? [code lang='ocaml'] let sum a = List.fold_left (fun x total -> x+total) 0 a [/code] or [code lang='ocaml'] let sum a = List.fold_right (fun x total -> x+total) a 0 [/code] – What is the best way to write this function? [...]