rf-web/vendor/bundle/gems/rouge-3.12.0/lib/rouge/demos/haskell
2019-10-21 10:18:17 +02:00

7 lines
202 B
Plaintext

quicksort :: Ord a => [a] -> [a]
quicksort [] = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
where
lesser = filter (< p) xs
greater = filter (>= p) xs