fork download
  1. let (<<) f g x = f (g x)
  2. let sorti = List.map snd << List.sort compare << List.mapi (fun i x -> (x, i))
  3. let f = sorti << sorti
  4. let g = print_newline << List.iter (Printf.printf "%d ") << f
  5. let () =
  6. g [1;100;10;10000;1000];
  7. g [3;1;4;1;5;9;2];
  8. g [0;1;0;1;0;1;0;1]
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
0 2 1 4 3 
3 0 4 1 5 6 2 
0 4 1 5 2 6 3 7