
27 Mar
2007
27 Mar
'07
12:07 p.m.
On Tue, Mar 27, 2007 at 08:02:18PM +1000, Matthew Brecknell wrote:
To: Matthias Fischmann
Cc: haskell-cafe@haskell.org From: Matthew Brecknell Date: Tue, 27 Mar 2007 20:02:18 +1000 Subject: Re: [Haskell-cafe] infinite lists Matthias Fischmann:
g = do n <- randomRIO (0,5) let l = replicate n '*' i | null l = [] | otherwise = join $ repeat l print (take 12 i)
If you had written (cycle l) instead of (join $ repeat l), you would have figured it out much quicker. :-)
Prelude> cycle [] *** Exception: Prelude.cycle: empty list
good point. and now i am learning a new word. eek! :) thanks - m