Haskell Quick Sort is the hallmark to show the concise and elegant of Haskell code
This is the first version of Quick Sort in Haskell
                -- good version quick sort
                quickSort::[Int]->[Int]
                quickSort [] = []
                quickSort [x] = [x]
                quickSort l = quickSort(left) ++ [p] ++ quickSort right 
                                    where
                                        left =  [x | x <- init l, x < p]
                                        right = [x | x <- init l, x >= p]
                                        p = last l 

                -- shorter version quick sort
                quickSort'::[Int]->[Int]
                quickSort' [] = []
                quickSort' (x:xs) = quickSort' ([ l | l <- xs, l < x]) ++ [x] ++ quickSort' ([ r | r <- xs, r >= x]) 

                -- more general version. 
                -- e.g. quickSort1 ["b", "a"] -- output ["a", "b"]
                -- note: quickSort1 [] -- get error
                -- print quickSort1 ([]::Int)  -- it works

                quickSort1::(Ord a)=>[a]->[a]
                quickSort1 [] = [] 
                quickSort1 (x:xs) = quickSort1([ l | l <- xs, l < x ]) ++ [x] ++ quickSort1 ([ r | r <- xs, r >= x])
            
Above code uses list comprehension, where cause, type class: Ord a