so, A common idiom when using Control.Monad.ST is to do some
complicated, state using computation to compute a big array which is
then used purely functionally as a read-only array in the rest of the
program.
to avoid the cost of copying the array at the end, we are
forced to use
afaik, this is fine. in fact, i use this idiom very frequently, so if
it's bad, i've never seen the badness of it.
On Tue, 30 Dec 2003, John Meacham wrote:
so, A common idiom when using Control.Monad.ST is to do some
complicated, state using computation to compute a big array which is
then
so, A common idiom when using Control.Monad.ST is to do some
complicated, state using computation to compute a big array which is
then used purely functionally as a read-only array in the rest of the
program.
to avoid the cost of copying the array at the end, we are forced to use
'unsafeFreeze'.