Skip to content

Instantly share code, notes, and snippets.

@mmagm
Created May 15, 2012 09:36
Show Gist options
  • Save mmagm/2700398 to your computer and use it in GitHub Desktop.
Save mmagm/2700398 to your computer and use it in GitHub Desktop.
haskell quick sort
qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (x:xs) = qsort lesser ++ [x] ++ qsort greater
where
lesser = filter (< x) xs
greater = filter (>= x) xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment