
20 Oct
2010
20 Oct
'10
12:53 p.m.
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.