I am currently learning Haskell on learnyouahaskell.com and they present us with the following quicksort algorithm for integer lists.
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smallerSorted = quicksort (filter (<=x) xs)
biggerSorted = quicksort (filter (>x) xs)
in smallerSorted ++ [x] ++ biggerSorted
Is there a way to modify it to accept any type of list? I was thinking of adding an extra parameter to indicate the the comparison operation to use