[Haskell-beginners] theStdGen unsafePerformIO

Edward Z. Yang ezyang at MIT.EDU
Sun Jan 9 18:40:31 CET 2011


Because unsafePerformIO returns a pure value 'a', GHC only computes it
once and then reuses it later (it's also why when you do this
you need to make sure you tell GHC not to inline the computation, which
will obviously change the semantics.)

Cheers,
Edward



More information about the Beginners mailing list