Sorting List with OCaml standard library function
问题 I'm studying OCaml and and doing various exercises on ordering data. I would like to understand how to use the standard librari List for ordering For example I would like to sort this array using these functions [94; 50; 6; 7; 8; 8] List.sort List.stable_sort List.fast_sort List.unique_sort What is the syntax to do it ? 回答1: If you want to use these functions on your list, you have to specifiy the comparison function. Quote from the documentation: The comparison function must return 0 if its