Haskell and random numbers

Posted by John D. on Stack Overflow See other posts from Stack Overflow or by John D.
Published on 2010-04-29T15:27:25Z Indexed on 2010/04/29 15:37 UTC
Read the original article Hit count: 174

Filed under:
|
|

Hi,

I've been messing with Haskell few days and stumbled into a problem.

I need a method that returns a random list of integers ( Rand [[Int]] ).

So, I defined a type: type Rand a = StdGen -> (a, StdGen). I was able to produce Rand IO Integer and Rand [IO Integer] ( (returnR lst) :: StdGen -> ([IO Integer], StdGen) ) somehow. Any tips how to produce Rand [[Int]]?

© Stack Overflow or respective owner

Related posts about haskell

Related posts about monads