Skip to content

Instantly share code, notes, and snippets.

@mgechev
Created July 12, 2013 18:17
Show Gist options
  • Select an option

  • Save mgechev/5986589 to your computer and use it in GitHub Desktop.

Select an option

Save mgechev/5986589 to your computer and use it in GitHub Desktop.
Quick sort in Haskell
quickSort :: Ord a => [a] -> [a]
quickSort [] = []
quickSort (x:xs) = quickSort left ++ [x] ++ quickSort right
where
left = [ y | y <- xs, y < x ]
right = [ y | y <- xs, y >= x ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment