Skip to content

Instantly share code, notes, and snippets.

@AlexMost
Created May 18, 2014 10:23
Show Gist options
  • Save AlexMost/19ddd0894f74a3896630 to your computer and use it in GitHub Desktop.
Save AlexMost/19ddd0894f74a3896630 to your computer and use it in GitHub Desktop.
qsort
qsort [] = []
qsort (x:xs) = qsort less ++ [x] ++ qsort more
where (less, more) = foldr (\el (l, m) -> if el <= x then (el:l, m) else (l, el:m)) ([], []) xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment