Resorting to general recursion, we can define a better sorting function:
But this is almost structurally recursive. We only need to get rid of the call to filter in the recursive call to quicksort.
filter
quicksort