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

Reid Barton rwbarton at math.harvard.edu
Wed Jun 17 01:24:07 EDT 2009


On Wed, Jun 17, 2009 at 02:28:55AM +0200, Gü?nther Schmidt wrote:
> Hi guys,
>
> I'd like to generate an infinite list, like
>
> ["a", "b", "c" .. "z", "aa", "ab", "ac" .. "az", "ba", "bb", "bc" ..  
> "bz", "ca" ...]

I'm surprised everyone is giving clever recursive solutions rather than

concatMap (\n -> replicateM n ['a'..'z']) [1..]

Regards,
Reid


More information about the Haskell-Cafe mailing list