[Haskell-cafe] Mutable data design question

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Fri Dec 3 14:22:04 EST 2004


Keean Schupke <k.schupke at imperial.ac.uk> writes:

> What happens with this method when the display needs refreshing, does
> the current state have to be recomputed every time ...

No. The new state is constructed from bits of old state and the
changed data. Applying a change on average requires logarithmic time
& memory wrt. the whole size. It does not invalidate the old state -
state is immutable.

http://www.cs.ubc.ca/local/reading/proceedings/spe91-95/spe/vol25/issue12/spe986.pdf

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Haskell-Cafe mailing list