Version française
Home     About     Download     Resources     Contact us    
Browse thread
jabbr
[ Home ] [ Index: by date | by threads ]
[ Search: ]

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

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

Juanco