Created
June 16, 2016 04:45
-
-
Save adpoe/e86773d7ae890afadc62cda29fc68056 to your computer and use it in GitHub Desktop.
Very simple Quicksort Implementation from "Learn You a Haskell For Great Good!"
This file contains 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 smallerSorted = quicksort [a | a <- xs, a <= x] | |
biggerSorted = quicksort [a | a <- xs, a > x] | |
in smallerSorted ++ [x] ++ biggerSorted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment