Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Quicksort in Haskell is very elegant, though not truly quicksort (not sort in place): https://wiki.haskell.org/Introduction#Quicksort_in_Haskell


You are the second person to reference quicksort in Haskell in this thread. The other person even mentioned it not being true quicksort. Who knew quicksort in Haskell was such a beloved piece of code!


Back when HotOrNot was hot, there was a site like it for rating code snippets. The top-rated one, I think I remember, was a broken version of this sort function: it had left out the recursions or something (I don't remember exactly), which made it even more 'elegant'.

This wasn't the only case I noticed of highly-rated broken code there. It took me a long time to take this lesson to heart about especially slick-looking code of my own.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: