On Wed, 20 Oct 2010, Henry Laxen wrote:

I am trying to do something that I think should be very simple, but I
just can't seem to figure out how.  The idea is that I want to use
runSTUArray to build up an array, but I want to look at the array
after each iteration and possiblely accumulate some elements.

The result of runSTUArray is an immutable array, it cannot be altered anymore, only read and transformed to a new copy. Everything that modifies the array must happen inside runSTUArray.

If you want other things than an array out of the ST monad then use runST.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to