[TYPES] Purely functional programming with reference cells

Francois Pottier Francois.Pottier at inria.fr
Wed Nov 5 10:48:26 EST 2014


Hello,

On Wed, Nov 05, 2014 at 05:55:59AM -0500, Eduardo León wrote:
> I think this gives us a beautiful account of reference cells, one that does
> not force us to call them "non-functional features": Every time we update a
> reference cell, we are asserting that the old and new values are
> equal. [...]  Furthermore, this also subsumes laziness as a special
> case.

Just a little remark. I am not sure what you mean by "this subsumes laziness".
In fact, it seems that if you want to implement "laziness" (that is, thunks)
using reference cells, then you need to be able to write a value into a
previously empty cell. So, you need to relax your condition and allow the new
value to be "more defined" (in some sense) than the old value.

More generally, I think you might be interested by the paper "LVars:
Lattice-based Data Structures for Deterministic Parallelism", by
Lindsey Kuper and Ryan R. Newton.

Best regards,

-- 
François Pottier
Francois.Pottier at inria.fr
http://gallium.inria.fr/~fpottier/


More information about the Types-list mailing list