[Haskell-cafe] Incremental array updates

Sjur Gjøstein Karevoll sjurberengal at gmail.com
Thu Feb 26 09:17:51 EST 2009


On Thursday 26 February 2009 15.07.34 Luke Palmer wrote:
> On Thu, Feb 26, 2009 at 6:53 AM, Daniel Kraft <d at 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 ?
>
> Luke

I just tested that, and both that and the original used about 500mb of memory.

I changed it to "(newarr ! ind) `seq` procOne (a+1) newarr" and it only used 
about 15mb.

-- 
Sjur Gjøstein Karevoll
sjurberengal at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090226/c667bdc3/attachment.bin


More information about the Haskell-Cafe mailing list