[Haskell-cafe] Need some help with an infinite list

Matthew Brecknell haskell at brecknell.org
Wed Jun 17 02:37:31 EDT 2009

Reid Barton wrote:
> I'm surprised everyone is giving clever recursive solutions rather than
> concatMap (\n -> replicateM n ['a'..'z']) [1..]
> Regards,
> Reid

Well, you've lost efficient sharing with respect to my previous solution
and one other.

But it's a fair call, so...

tail $ concat $ iterate (map (:) ['a'..'z'] <*>) [[]]


More information about the Haskell-Cafe mailing list