4 ms·
The C code implement quicksort, the Haskell code does not. It has different (worse) space characteristics. Proper quicksort in Haskell is not a two-liner.
by akho 5y ago
The C code implement quicksort, the Haskell code does not. It has different (worse) space characteristics. Proper quicksort in Haskell is not a two-liner.
- EamonnMR 5y agoIt's a parlor trick, but a cool one is my point.
- vidarh 5y agoBut you can make that parlor trick work ok in C too if you even the playing field by implementing a partition() helper separately. The Haskell version reveals more of a deficiency in the C standard library than the language.
- AnimalMuppet 5y agoA parlor trick that doesn't implement what it claims to, even if cool, doesn't make a point very well...
- poetaster 5y agoA sort is a sort or it isn't a sort? Don't get it. Is the claim that the first quick sort impl. in haskell on rosetta is NOT a quick sort?
- akho 5y agoQuicksort is a specific algorithm involving two array pointers and swapping values. The haskell implementation in question is not it. It’s not a “claim”, it is what it is.
- poetaster 5y agoIs it a parlour trick in lisp or erlang?