The author of Pugs (Perl6 implemented in Haskell) gives a nice solution to the problem of generating the Hamming numbers in the following interview: http://www.perl.com/pub/a/2005/09/08/autrijus-tang.html?page=last