qsort [] = []
qsort (p:xs) = (qsort lt) ++ [p] ++ (qsort gt)
  where (lt, gt) = partition' (\x -> x <= p) xs
        
partition' _ [] = ([], [])
partition' f (x:xs) 
  | f x       = (x:ys, zs)
  | otherwise = (ys, x:zs)
  where (ys, zs) = partition' f xs 

main = do
  let li = [5,2,1,4,3,0]
  print $ li
  print $ (qsort li)
  print $ (partition' odd li)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: