Because the recursive implementation is surprisingly straightforward and concise, and more-less demonstrates what the whole paradigm is about. As much as I hate to admit it, it's a good learning artifact.
This is why developer docs are trash. Because 90% of us can’t even identify when we are talking over everyone’s heads.
It's also technically not quicksort
How does FP handle the random selection?
You could use a monad/external state for an OS-level RNG, or define a purely functional PRNG
(Merge sort is of course the natural sort for lists, but qs is like 2 lines of Haskell so it gets demoed for being clever)
Surely you mean mergesort, that's the classic FP sorting example.
[0] https://qnikst.github.io/posts/2020-10-18-quicksort.html
Yeah this is lousy. This wouldn’t teach anyone anything.