English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-10 (19:19)
From: Juancarlo_Añez <juanca@s...>
Subject: RE: [Caml-list] Newbe question: Strings <-> char lists

 | As far as I now, Haskell actually implements strings as 
 | lists of characters, 

I'm pretty sure that Haskell lets you *treat* strings as list of characters,
yet provides an efficient implementation of strings underneath.

 | 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.

I don't mind that strings are not lists in OCAML, but I would still like to
convert (through a function) a string to a char list. There are no functions
for doing that in the stdlib, and I haven't been able to write my own (the
string concatenation operator does not accept a char [naturally] and there
are no "append" or "insert" functions in the library).