BP> If I want a small example to show to people I usually use zipWith.

I'd suggest unfoldr + lazyness, such as

hammings = 1 : unfoldr (Just . generator) (map (\n -> map (n*) hammings) 
[2,3,5])
    where generator xss =
        let x = minimum $ map head xss
        in (x, map (dropWhile (x==)) xss)

I guess, it's tough to reproduce even in languages like Prolog.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to