From: Nicolas George <nicolas.george@...>
Subject: [Camomile-devel] Efficient strings
Date: Thu, 15 Apr 2004 19:46:41 +0200
> (Is this list really active? The archives on <URL:
> http://sourceforge.net/mailarchive/forum.php?forum=camomile-devel > does
> not show any message after december 2002.)
I would like to resurrect it.
> What I really miss when programming in OCaml is an efficient string type
> in functionnal style. That would be a string with:
> - immutable values;
> - fast concatenation;
> - fast substring extraction;
> - fast moving of an index inside it.
> I believe there are tree-based implementations of such types in others
> language (I've heard of c++'s "ropes"), but I do not know the details.
> Maybe such a type would fit in Camomille, if someone knows how to do
Yes, it would be nice. But, such a structure would be easily made
polymorphic. In this case, it would belong to a general data
structure library (like SF extlib). Then Camomile would provide an
interface to it.
I think Paulson's book (ML for a working programmer) show a SML code
of a functional array with O(n log n)-time for all operations you
listed. It would be a good starting point.