rf-web/vendor/bundle/gems/rouge-3.12.0/lib/rouge/demos/haskell

7 lines
202 B
Plaintext
Raw Normal View History

2019-10-21 08:18:17 +00:00
quicksort :: Ord a => [a] -> [a]
quicksort [] = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
where
lesser = filter (< p) xs
greater = filter (>= p) xs