Hi,

I am running ocaml 3.12.1 and getting an error message. Is it an incompatible version error or a missing 'core' module?

let permute array =
  let length = Array.length array in
  for i=0 to length - 2 do
  let j = i + 1 + Random.int (length - i - 1) in
  let tmp = array.(i) in
  array.(i) <- array.(j);
  array.(j) <- tmp
  done ;;
let ar = Array.init 20 ~f:(fun i -> i) ;;
-: "Error: The function applied to this argument has type (int -> 'a) -> 'a array
     This argument cannot be applied with label ~f."

Best regards,

Jean