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 17:40:34 +0200
On Sat, 2007-10-13 at 09:56 -0400, Brandon S. Allbery KF8NH wrote:
> Now you need to start forcing things; given laziness, things tend to  
> only get forced when in IO, which leads to time being accounted to  
> the routine where the forcing happened.  If random / randomR are  
> invoked with large unevaluated thunks, their forcing will generally  
> be attributed to them, not to functions within the thunks.

But AFAIK random and randomR only take a StdGen (plus a range argument
in case of randomR) as argument so I don't understand where the
unevaluated thunks might be actually? (Maybe I should have said that
random and randomR are the ones from GHC's System.Random module.)

Thanks,
Thoralf


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

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