News for hackers. Stuff that matters.
Re:Ask HN: What's the most elegant piece of code you've seen? by visof on Sunday January 31, 2016 @04:49AM (#11005870)
quicksort [] = []

quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)

    where

        lesser = filter (< p) xs

        greater = filter (>= p) xs
Re:Ask HN: What's the most elegant piece of code you've seen? by alisey on Sunday January 31, 2016 @09:37AM (#11006504)
Keep in mind that this algorithm is not in-place, so it wouldn't be fair to say that it's more 'elegant' than imperative quicksort implementations.