Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alex Baretta <alex@b...>
Subject: Re: [Caml-list] Newbe question: Strings <-> char lists
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.


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