Skip to content

Instantly share code, notes, and snippets.

@fcamel
Created May 24, 2009 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcamel/117120 to your computer and use it in GitHub Desktop.
Save fcamel/117120 to your computer and use it in GitHub Desktop.
qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (x:xs) = qsort small ++ [x] ++ qsort big
where small = [x'| x' <- xs, x' < x]
big = [x'| x' <- xs, x' >= x]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment