From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 57E8EBC88 for ; Thu, 10 Feb 2005 18:36:11 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1AHaAT3012736 for ; Thu, 10 Feb 2005 18:36:11 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA29232 for ; Thu, 10 Feb 2005 18:36:10 +0100 (MET) Received: from alex.barettalocal.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1AHa9sk012731 for ; Thu, 10 Feb 2005 18:36:10 +0100 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by alex.barettalocal.com (Postfix) with ESMTP id C44392BBB30; Thu, 10 Feb 2005 18:36:09 +0100 (CET) Message-ID: <420B9B89.30209@barettadeit.com> Date: Thu, 10 Feb 2005 18:36:09 +0100 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1 X-Accept-Language: it, en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Juancarlo_A=F1ez?= Cc: caml-list@inria.fr Subject: Re: [Caml-list] Newbe question: Strings <-> char lists References: <200502101718.j1AHIKDu027223@concorde.inria.fr> In-Reply-To: <200502101718.j1AHIKDu027223@concorde.inria.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Miltered: at nez-perce with ID 420B9B8A.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 420B9B8A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 caml-list:01 char:01 wrote:01 char:01 haskell:01 treating:01 haskell:01 implements:01 abstraction:01 ocaml:01 ocaml:01 baretta:01 mighty:98 strings:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: Juancarlo Aņez wrote: > How does one convert a char list to a string? > > Why aren't functions for converting char lists to strings and back part of > the standard library. > > Haskell allows treating any string as a char list. I don't know what it does > behind the scenes, but it is mighty convenient. As far as I now, Haskell actually implements strings as lists of characters, which might or might not be a useful abstraction of a string, but it is definitely inconvenient from the standpoint of computational and memory complexity. This explains the design choices behind the Ocaml string type as well as why a mapping from strings to char lists is not "standard" in Ocaml. Alex -- ********************************************************************* http://www.barettadeit.com/ Baretta DE&IT A division of Baretta SRL tel. +39 02 370 111 55 fax. +39 02 370 111 54 Our technology: The Application System/Xcaml (AS/Xcaml) The FreerP Project