quicksort :: (Ord a) => [a] -> [a] quicksort [] = [] quicksort (x:xs) = let smallerSorted = quicksort [a | a <- xs, a <= x] biggerSorted = quicksort [a | a <- xs, a > x] in smallerSorted ++ [x] ++ biggerSorted #### sub multi_thread_sort { my @list = @_; my $pivot = shift @list; my @lowList = grep { $_ < $pivot } @list; my @highList = grep { $_ >= $pivot } @list; # Now start two threads to sort the two lists concurrently. return ( @lowList, $pivot, @highList ); }