3 ms·
Haskell: 5 line quicksort and parsers/compilers. I do like the language, though.
by als0 6y ago
Haskell: 5 line quicksort and parsers/compilers. I do like the language, though.
- sn41 6y agoActually: in-place quicksort in Haskell is as verbose as in other languages. The 5 line quicksort uses linear order additional space.
- Blikkentrekker 6y agoThe matter with Haskell is that one often doesn't use in-place updates and that the language is designed such that this can be more efficient than in many other languages though Ocaml probably does this better with it's incremental garbage compilation strategy.
- AzzieElbab 6y agoWell, that 5 line quicksort is fake. Haskell is good for writing other languages like Elm for example
- usrnm 6y agoYou can write quicksort in C++ in about the same number of lines using std::partition from the standard library.