Are there standard sorting functions in SML? The documentation on the Internet is so scarce I couldn\'t find any.
here is my sml sorting algorithm
fun sort list = foldr (fn (x,lst)=> List.filter (fn a => a < x) lst @ [x] @ List.filter (fn a => a >= x) lst ) [] list; sort [5,1,5,0,2,5,~2,5,~10,0]; output: [~10,~2,0,0,1,2,5,5,5,5]
I hope it helps