Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Strings as arrays or lists...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: oliver@f...
Subject: [Caml-list] Strings as arrays or lists...
Hello,


in Haskell, strings are lists of chars.

In Ocaml, strings seem to be array-like,
but it's not possible to apply Array-functions
on Strings, but nevertheless, the char's of a
string are used in a very similar way, as arrays.

The indexing is done with .(idx) in the one case
and with .[idx] in the other case.


Well, when strings would be lists of chars,
List-commands like List.map and List.filter
could be used.
This would be more FPL-like. (And more convenient
and IMHO more consistently.)


But even if only the imperative Array-access would
be possible (instead of the FPL-like Lists), it would
be more convenient then to have such a string-type,
which can't be used with the many libraries.


Any suggestions on that topic?

Ciao,
   Oliver
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners