Have the recursive quicksort typechecking, guaranteeing a sorted result.