David Rajchenbach-Teller <david.tel...@ens-lyon.org> writes: > On Sat, 2009-04-04 at 19:35 -0400, Yaron Minsky wrote: >> On Sat, Apr 4, 2009 at 5:51 PM, Goswin von Brederlow >> <goswin-...@web.de> wrote: >> Mutable/Immutable can really nicely done with phantom types >> and is >> independent of the data structure used. It works for strings, >> lists, >> arrays, sets, trees, ... and I think all standard modules >> should have >> it. The official standard lib is rather lacking there but that >> is why >> there is Batteries. The more I hear/see of it the more I like >> it. >> >> On this note, there's a small variation on this idea that we've >> experimented with at Jane Street that I think is worth mentioning. >> When people do this kind of thing, they usually have two phantom tags, >> "immutable" and "mutable", but, there is another natural one to add: >> "readonly". > > Actually, thats exactly what we have for strings and arrays in > Batteries. > > Cheers, > David
Where do you have an immutable string? One where you are sure that nobody can hold a [> `Write] reference to the string. I only saw the read and write phantom flags. MfG Goswin _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs