Version française
Home     About     Download     Resources     Contact us    
Browse thread
Strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Rajchenbach-Teller <David.Teller@e...>
Subject: Re: [Caml-list] Strings

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-v-b@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

>