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.2 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 215A1BBAF for ; Sun, 5 Apr 2009 11:36:07 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjEDANYY2EnCpx6vi2dsb2JhbACWJgEBARUKGLJlhA8G X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208";a="27055762" Received: from smtpka.univ-orleans.fr (HELO ka.univ-orleans.fr) ([194.167.30.175]) by mail1-smtp-roc.national.inria.fr with ESMTP; 05 Apr 2009 11:36:06 +0200 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by ka.univ-orleans.fr (Postfix) with ESMTP id B8D3712AD42; Sun, 5 Apr 2009 11:36:06 +0200 (CEST) Received: from [192.168.0.12] (ras75-4-82-235-58-110.fbx.proxad.net [82.235.58.110]) by smtps.univ-orleans.fr (Postfix) with ESMTP id 97BBC36E60; Sun, 5 Apr 2009 11:36:07 +0200 (CEST) Subject: Re: [Caml-list] Strings From: David Rajchenbach-Teller To: yminsky@gmail.com Cc: caml-list@yquem.inria.fr In-Reply-To: <891bd3390904041635x6a6997ddpc1e12f90d0fc3153@mail.gmail.com> References: <200904031256.33357.jon@ffconsultancy.com> <1238836474.6250.11.camel@Blefuscu> <87ocvc6qa1.fsf@frosties.localdomain> <891bd3390904041635x6a6997ddpc1e12f90d0fc3153@mail.gmail.com> Content-Type: text/plain Date: Sun, 05 Apr 2009 11:36:42 +0200 Message-Id: <1238924202.6147.9.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit 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 2009:98 2009:98 wrote:01 wrote:01 caml-list:01 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 >