by kaykay · 9y ago · 0 comments
I believe the right implementation should be something like:
main :: IO ()
main = print $ quicksort [1, 123, 42, 90, 1, 23, 24, 12, 3]
quicksort [] = []
quicksort (x:xs) = quicksort left ++ [x] ++ quicksort right
where left = [ y | y <- xs, y < x ]
right = [ y | y <- xs, y >= x ]It's not how people should choose a language, but I'd wager it plays a non-trivial part even if only from laziness alone.
We have to remember we aren't marketing to perfect* developers but more to the average if an aim is mass adoption.
*Perfect as in follows general programming best practices. Following best practices is not always best. Not trying to make a value judgment here.