5 ms·
It indeeds looks a bit magical, like the infamous fibonacci example that uses lazy lists. I don't think that list comprehensions are very idiomatic in Haskell,
by emillon 13y ago
It indeeds looks a bit magical, like the infamous fibonacci example that uses lazy lists.
I don't think that list comprehensions are very idiomatic in Haskell, one would probably use Data.List.partition instead:
qsort [] = []
qsort (p:xs) = low ++ [p] ++ high
where (low, high) = partition (< p) xs