Created
July 3, 2014 01:43
-
-
Save krishnabhargav/59661c31265496f1e54e to your computer and use it in GitHub Desktop.
Haskell is beautiful!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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