Created
June 21, 2015 05:31
-
-
Save KPCCoiL/45e74f4ae6d3fde612fe to your computer and use it in GitHub Desktop.
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
module Main | |
qsort : Ord a => List a -> List a | |
qsort [] = [] | |
qsort (x :: xs) = smaller ++ [x] ++ larger | |
where smaller = qsort [y | y <- xs, y <= x] | |
larger = qsort [y | y <- xs, y > x] | |
main : IO () | |
main = printLn $ qsort [5, 1, 5, 89, 1, 8, 5, 78] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment