let shuffle xs =
  Random.init 42;
  let a = Array.of_list xs in
  let n = Array.length a in
  for i = n - 1 downto 1 do
    let j = Random.int (i + 1) in
    let tmp = a.(i) in
    a.(i) <- a.(j);
    a.(j) <- tmp
  done;
  Array.to_list a

;;

List.fold_left (+) 0 (shuffle [1;2;3;4;5;6;7;8;9;10])
