Skip to content

Instantly share code, notes, and snippets.

@Tyralion
Created March 15, 2016 16:41
Show Gist options
  • Select an option

  • Save Tyralion/31354a1612173ea087e7 to your computer and use it in GitHub Desktop.

Select an option

Save Tyralion/31354a1612173ea087e7 to your computer and use it in GitHub Desktop.
qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (a:xs) = let
helper [] y l = y : qsort l
helper (k:ks) y l | k <= y = helper ks k (y : l)
| otherwise = helper ks y (k : l)
in helper xs a []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment