From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 18A00BBAF for ; Sun, 5 Apr 2009 23:40:30 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4GAJrB2EnZSMDqZGdsb2JhbACBUpRHGgsDBwcPBbFHhA8G X-IronPort-AV: E=Sophos;i="4.39,327,1235948400"; d="scan'208";a="37912942" Received: from fmmailgate03.web.de ([217.72.192.234]) by mail4-smtp-sop.national.inria.fr with ESMTP; 05 Apr 2009 23:40:29 +0200 Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate03.web.de (Postfix) with ESMTP id 5B11AFA01F4A; Sun, 5 Apr 2009 23:40:29 +0200 (CEST) Received: from [78.43.226.218] (helo=frosties.localdomain) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #277) id 1Lqa4r-0000i6-00; Sun, 05 Apr 2009 23:40:29 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.69) (envelope-from ) id 1Lqa4q-0007ar-SN; Sun, 05 Apr 2009 23:40:28 +0200 From: Goswin von Brederlow To: David Rajchenbach-Teller Cc: yminsky@gmail.com, caml-list@yquem.inria.fr Subject: Re: [Caml-list] Strings References: <200904031256.33357.jon@ffconsultancy.com> <1238836474.6250.11.camel@Blefuscu> <87ocvc6qa1.fsf@frosties.localdomain> <891bd3390904041635x6a6997ddpc1e12f90d0fc3153@mail.gmail.com> <1238924202.6147.9.camel@Blefuscu> Date: Sun, 05 Apr 2009 23:40:28 +0200 In-Reply-To: <1238924202.6147.9.camel@Blefuscu> (David Rajchenbach-Teller's message of "Sun, 05 Apr 2009 11:36:42 +0200") Message-ID: <87myaubwz7.fsf@frosties.localdomain> User-Agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.21 (linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX191B1DK8USIU7CYd9f7ayRvtEiGM8/bpP5c/zSd ZEzuv0LPyeq063+lJKZdvTPxUzzJF7ysTWvoIw/suPslI2RvfG KacwrrZSU= X-Spam: no; 0.00; ens-lyon:01 yaron:01 minsky:01 mutable:01 arrays:01 lib:01 experimented:01 mutable:01 arrays:01 cheers:01 flags:01 2009:98 2009:98 mfg:98 wrote:01 David Rajchenbach-Teller 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 >> 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