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

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

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: