How can I generate different random values in Haskell?
There are two problems with your code: You are calling unsafePerformIO, but explicitly violating the contract of that function. It is on you to prove that the thing you provide to unsafePerformIO is actually pure, and the compiler is within its rights to act as if that’s the case, and here it is definitely not. … Read more