[Haskell-cafe] Destructive updates to plain ADTs

Milan Straka fox at ucw.cz
Tue Sep 11 09:49:25 CEST 2012


> > is there any way to perform a destructive update on a plain ADT?
> Hi Milan, perhaps this is a dumb question, but given that you're using a lazy 
> functional language: why do you want to do destructive updates at all?
> Perhaps you'd be better off using an imperative/object-oriented language?

I am one of the maintainers of the containers package, so I definitely
want to stick to Haskell :)

The reason for me wanting to do destructive updates is speed -- if
I could perform destructive updates during the construction of
persistent structure (e.g., inside Data.Map.fromList), the performance
would improve.

> > ... I would like just to run some benchmarks and see the results.
> Running benchmarks for destructive updates in Haskell seems a waste of time(?)

Johan successfully improved unordered-containers by using destructive
updates during construction, but he is using Array# where destructive
updates are possible. I was wondering if I could do similar thing in


More information about the Haskell-Cafe mailing list