[Haskell-cafe] idea for avoiding temporaries

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Thu Mar 8 16:32:01 EST 2007


On Mar 8, 2007, at 16:27 , David Roundy wrote:

> The real issue for me is that DiffArrays only make any sense at all  
> if you
> often update a subset of your array, which I never expect to do...  
> so even
> if they were efficiently implemented to the point of zero overhead,  
> they
> would gain me nothing, and that's almost certainly overly optimistic.

But that's not my understanding of what's *supposed* to be  
happening:  the point of DiffArrays is is not optimizing partial  
updates, it's optimizing the head at the expense of any (by intent  
few or none) references that might be held elsewhere.  As such, if  
there are no such references the DiffArray *should* get you cheap in- 
place (destructive) updates.

It's possible that the current *implementation* is flawed in the way  
you describe; if so, that should probably be brought up on the  
libraries list, because the documentation and the intent seem to be  
saying otherwise.

-- 
brandon s. allbery    [linux,solaris,freebsd,perl]     allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH





More information about the Haskell-Cafe mailing list