[Haskell-cafe] Re: Why doesn't laziness save the day here?

2010-01-07 Thread Dale Jordan
o...@okmij.org wrote: The others have already pointed out the problem with the imperative solution, which used the mutation of the global state with the new random seed. Imperative approach is indeed often a problem. As Daniel Fischer pointed out, my immediate problem was that iterateR never f

[Haskell-cafe] Why doesn't laziness save the day here?

2010-01-04 Thread Dale Jordan
such as produced by MonadRandom's getRandoms, but I only have a pink belt in Haskell-fu. Can anyone explain why this is looping or point out a better way to generate an arbitrary-length random list while still being able to reuse the generator? (I'd rather not use sp