haskell-cafe@haskell.org
[Top] [All Lists]

Re: [Haskell-cafe] Performance problem with random numbers

Subject: Re: [Haskell-cafe] Performance problem with random numbers
From: ntupel
Date: Sat, 13 Oct 2007 19:30:06 +0200
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


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

<Prev in Thread] Current Thread [Next in Thread>