> since for some reason in FP languages quicksort is typically next after "hello world"
How does FP handle the random selection?
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)