Skip to content

Instantly share code, notes, and snippets.

@mzdravkov
Created July 2, 2015 16:02
Show Gist options
  • Save mzdravkov/2af57573906db132772f to your computer and use it in GitHub Desktop.
Save mzdravkov/2af57573906db132772f to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment