[Haskell-cafe] Performance problem with random numbers

ntupel ntupel at googlemail.com
Sat Oct 13 13:30:06 EDT 2007

On Sat, 2007-10-13 at 12:42 -0400, Brandon S. Allbery KF8NH wrote:
> Your apparently simple StdGen argument is actually a sort of program  
> state (represented by unevaluated thunks, not by a state monad; see  
> below) which gets altered with every invocation of random.  If  
> nothing is forced until the very end, it in effect becomes an  
> expression which produces the desired StdGen, with the uses of the  
> previous StdGen values as "side effects" of its computation that  
> occur when the thunk is evaluated at the end.  I'm not sure I'm up to  
> working through an example of what this looks like.

Thanks Brandon. I understand your argument but I don't know how to put
it into practice, i.e. how to force the evaluation of StdGen.

- Thoralf

More information about the Haskell-Cafe mailing list