Hi, you need to reallise that Haskell is a pure language. That means a function has the same result if you call it with the same arguments (deterministic). A function that produces random numbers are not of such kind in the first place. However, what you need to do is to pass the random number generator though the function: See e.g. System.Random.random [1] which takes the generator and gives you a random value and the new generator back. Georg [1] http://www.haskell.org/ghc/docs/latest/html/libraries/base/System.Random.htm... PS: this question is more appropriate for haskell-cafe. On Thu, 11 Nov 2004 14:40:35 +0000, Jose manuel Hernando Cobeña <elreyjoseman@hotmail.com> wrote:
I need generate random numbers by create polygons with "wxHaskell", I am searching in the web, but all I only find IO functions like
test :: Integer -> IO Integer test n = do x <- randomRIO (1, n) return x I need this but with types :: Integer -> Integer
Thanks
Escapadas, fines de semana, vacaciones, reservas. Organiza y contrata tus viajes aquí.
_______________________________________________
Haskell mailing list
Haskell@haskell.org
-- ---- Georg Martius, Tel: (+49 34297) 89434 ---- ------- http://www.flexman.homeip.net ---------