On Sat, Oct 3, 2009 at 1:57 AM, Duncan Coutts
duncan.cou...@googlemail.comwrote:
Internally, each time you demand the next random number, it is mutating
the internal ST array.
This is the same thing that the Statistics.RandomVariate code in the
statistics package does, and it can be very
On Fri, 2009-10-02 at 20:00 -0700, Gregory Crosswhite wrote:
Sorry to reply to my own posting, but... AHA! I see now what's going
on. The purpose of the rank-2 qualifier is to prevent STRefs from
leaking outside of the runST call, and what the code does at the
lowest level is that it
On Fri, 2 Oct 2009, Gregory Crosswhite wrote:
Do you all have any thoughts on ways to solve this problem, and/or a
high-level explanation of what is going behind the scenes with STRefs and
MArrays?
http://www.haskell.org/haskellwiki/Monad/ST
___
Hey everyone,
I am thinking about creating a particular data structure with an
immutable and mutable version. The key of my problem is that I would
like the user to be able to work with a mutable version of the data
within a non-IO monad and then get an immutable value at the end,
Sorry to reply to my own posting, but... AHA! I see now what's going
on. The purpose of the rank-2 qualifier is to prevent STRefs from
leaking outside of the runST call, and what the code does at the
lowest level is that it passes around a token state object to force
the compiler to