Skip to content

Instantly share code, notes, and snippets.

@krishnabhargav
Created July 3, 2014 01:43
Show Gist options
  • Save krishnabhargav/59661c31265496f1e54e to your computer and use it in GitHub Desktop.
Save krishnabhargav/59661c31265496f1e54e to your computer and use it in GitHub Desktop.
Haskell is beautiful!
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let small = quicksort [ a | a <- xs, a <=x]
large = quicksort [ a | a <- xs, a > x]
in small ++ [x] ++ large
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment