Re:Haskell One Liners to Impress Your Friends
by boryas on Saturday June 04, 2011 @05:50AM
(#2619243)
I'm surprised this is missing the canonical quicksort in one line of Haskell
[ Parent
| on HN ]
Re:Haskell One Liners to Impress Your Friends
by danieldk on Saturday June 04, 2011 @06:16AM
(#2619274)
But the 'canonical quicksort' is not quicksort ;), just a slow look-alike:
http://augustss.blogspot.com/2007/08/quicksort-in-haskell-qu...
Re:Haskell One Liners to Impress Your Friends
by jrockway on Saturday June 04, 2011 @08:14AM
(#2619373)
No, it's quicksort. It's just not the best implementation of quicksort.
Re:Haskell One Liners to Impress Your Friends
by danieldk on Sunday June 05, 2011 @05:41PM
(#2622908)
No, it's not. First line of Hoare's 1962 paper describing quicksort:
A description is given of a new method of sorting in the random access store of a computer
The paper also emphasizes the use of in-place mutations in quicksort. The qsort one-liner uses lists, which are not random-access and cannot be modified in-place.
Re:Haskell One Liners to Impress Your Friends
by omaranto on Saturday June 04, 2011 @01:30PM
(#2619928)
It's because this post is part of a meme: someone wrote a post with precisely this list of 10 one liners in some language (Scala, I think) and then several others have written translations to other languages.