Optimization & Destructive Updates

Lajos Nagy lnagy at fit.edu
Fri Apr 14 12:25:51 EDT 2006


I was just musing the other day about the possibility of allowing 
(efficient and transparent) destructive updates in certain situations. 
Take the following (giberish) example:

f xs = g xs []
   where g [] ac = ac
         g (x1:x2:xs) ac = g xs (ac ++ [x2,x1])

It seems to me that the list concatenation in the tail recursion call can 
be safely performed destructively.  Does anybody know about any research 
going on in this area?  (Mind you: no linear types, no monads, only 
`under the hood' compiler optimization.)

I'm aware of the fact that this would imply another kind of overloading 
(destructive vs. non-destructive) for functions which also seems an 
interesting research area.

Regards,

-- Lajos Nagy
Computer Science Ph.D. Student,  Florida Institute of Technology




More information about the Glasgow-haskell-users mailing list