Function that produces \$a^nb^nc^n\$
Your first solution could be more elegantly written as:

f :: [String]
f = [concatMap (replicate n) "abc" | n &lt;- [0..]]


The basic operating principle would be the same, though.

A general sorting algorithm would be O(n log n) at best, so I don't believe that sort would be a good idea.