Skip to content

Instantly share code, notes, and snippets.

@pedrominicz
Last active October 19, 2019 14:49
Show Gist options
  • Save pedrominicz/e277d60eb59f0c11b5b3a549d066730f to your computer and use it in GitHub Desktop.
Save pedrominicz/e277d60eb59f0c11b5b3a549d066730f to your computer and use it in GitHub Desktop.
Quick! Quicksort in Haskell!
module Quick where
qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (x:xs) = less ++ x:more
where less = qsort $ filter (< x) xs
more = qsort $ filter (>= x) xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment