qsort([]) -> []; qsort([H|T]) -> {Bigger,Smaller} = lists:partition(fun(N) -> N > H end, T), qsort(Smaller) ++ [H] ++ qsort(Bigger).