[Haskell-cafe] random question

Michael Mossey mpm at alumni.caltech.edu
Wed Oct 7 17:28:59 EDT 2009



Luke Palmer wrote:
> On Wed, Oct 7, 2009 at 2:59 PM, Michael Mossey <mpm at alumni.caltech.edu> wrote:
>> My thread about randomness got hijacked so I need to restate my remaining
>> question here. Is it acceptable to write pure routines that use but do not
>> return generators, and then call several of them from an IO monad with a
>> generator obtained by several calls to newStdGen?
> 
> It's gross.  What if you don't want IO as part of this computation?
> 

I don't quite follow your response. I want a program that initializes the 
generator from the global generator because I want different behavior every 
time I run it. So it will need IO. That's what I was trying to demonstrate. 
And I was wondering if one can get around the difficulty of passing the 
generator from call to call by using newStdGen in this way.

Mike


More information about the Haskell-Cafe mailing list