Hello Larry,

Sunday, January 3, 2010, 8:46:30 PM, you wrote:

> Using "seed<-getSeed"  from the  ghci command line works. Why doesn't
> it work in a
> script?

because it's a feature of ghci command prompt, not haskell language.
use smth like this:

randList minval maxval = do
  seed  <-  getSeed
  return$ randomRs (minval,maxval) (mkStdGen seed)

of course, it will make randList non-pure function that may return
different results on different calls but that that you mean, no? ;)


-- 
Best regards,
 Bulat                            mailto:bulat.zigans...@gmail.com

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

Reply via email to