Erlang quicksort implementation.