caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Vec: a functional implementation of extensible arrays
@ 2007-07-18 17:32 Luca de Alfaro
  2007-07-19  7:45 ` [Caml-list] " Loup Vaillant
  0 siblings, 1 reply; 10+ messages in thread
From: Luca de Alfaro @ 2007-07-18 17:32 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

Dear All,

I would like to share with you an Ocaml implementation of extensible
arrays.  The implementation is functional, based on balanced trees (and on
the code for Set and Map); I called the module Vec (for vector - I like
short names).  You can find it at http://www.dealfaro.com/home/vec.html
Module Vec provides, in log-time:

   -  Access and modification to arbitrary elements (Vec.put n el v puts
   element el in position n of vector v, for instance).
   - Concatenation
   - Insertion and removal of elements from arbitrary positions
   (auto-enlarging and auto-shrinking the vector).

as well as:

   - All kind of iterators and some visitor functions.
   - Efficient translation to/from lists and arrays.

An advantage of Vec over List, for very large data structures, is that
iterating over a Vec of size n requires always stack depth bounded by log n:
with lists, non-tail-recursive functions can cause stack overflows.

I have been using this data structure for some months, and it has been very
handy in a large number of occasions.  I hope it can be as useful to you.

I would appreciate all advice and feedback.  Also, is there a repository
where I should upload it?  Do you think it is worth it?

All the best,

Luca

[-- Attachment #2: Type: text/html, Size: 1468 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-07-20 16:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-18 17:32 Vec: a functional implementation of extensible arrays Luca de Alfaro
2007-07-19  7:45 ` [Caml-list] " Loup Vaillant
2007-07-19  8:17   ` Hugo Ferreira
2007-07-19 16:51     ` Luca de Alfaro
2007-07-19 17:13     ` Luca de Alfaro
2007-07-19 16:59   ` Luca de Alfaro
2007-07-20  7:35     ` Loup Vaillant
2007-07-20  8:14       ` Jon Harrop
2007-07-20 15:42         ` Luca de Alfaro
2007-07-20 16:45           ` Brian Hurt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).