I installed the System.Random package with cabal (Prelude System.Random >), but when I compile a simple program like this:
threeCoins :: StdGen -> (Bool, Bool, Bool)
threeCoins gen =
let (firstCoin, newGen) = random gen
(secondCoin, newGen’) = random newGen
(thirdCoin, newGen’’) = random newGen’
in (firstCoin, secondCoin, thirdCoin)
a message tell me that StdGen it’s not a recognized type. I’m going crazy with that. Someone can explain me what’s wrong?
I write indeed (import System.Random) in the .hs file, but the problem persists. Is it possible that the code is obsolete, I mean StdGen is not already a type of System.Random?