Hi,
I seem to be a little stuck with incremental array updates... I've got
an array of few (some thousand) integers, but have to do a calculation
where I incrementally build up the array. For sake of simplicity, for
now I don't use a State-Monad but simply pass the array as state down
the
You need to use STUArray. The Data.Array
completely-immutable-and-boxed arrays are ok only for tasks where you
build an array once and don't modify it, and where you need array
elements to be lazy.
The // operation creates a copy of the whole array with one element
modified. It should probably be
On Thu, Feb 26, 2009 at 6:53 AM, Daniel Kraft d...@domob.eu wrote:
procOne (a + 1) (newarr `seq` newarr)
The semantics of seq are: a `seq` b = _|_ if a = _|_, b otherwise. This
implies that x `seq` x = x, and this seq is superfluous.
Maybe you meant newarr `seq` procOne (a+1) newarr ?
Am Donnerstag, 26. Februar 2009 14:53 schrieb Daniel Kraft:
Hi,
I seem to be a little stuck with incremental array updates... I've got
an array of few (some thousand) integers, but have to do a calculation
where I incrementally build up the array. For sake of simplicity, for
now I don't
On Thu, Feb 26, 2009 at 02:53:42PM +0100, Daniel Kraft wrote:
I seem to be a little stuck with incremental array updates... I've got
an array of few (some thousand) integers, but have to do a calculation
where I incrementally build up the array. For sake of simplicity, for
now I don't