Optimization & Destructive Updates
Robin Bate Boerop
robin_bb at acm.org
Fri Apr 14 13:12:55 EDT 2006
I am interested in better understanding what optimizations of this
sort GHC performs. I second Lajos's question.
I sometimes write code using StateMonad, and expect some destructive
updates. Judging by the performance of the resulting executable, the
updates are nondestructive. (But, no, I haven't verified this by
examining the object code.)
--
Robin Bate Boerop
On 14-Apr-06, at 12:25 PM, Lajos Nagy wrote:
>
> 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
>
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
More information about the Glasgow-haskell-users
mailing list