Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Generation of streams is slow
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] Generation of streams is slow

>A way to avoid that (I mean creation of a reversed list and reversion)
>is to use mutable types, what the list type is not.

Has anybody written a simple "circular linked list" implementation in ocaml?  Basically, you'd want it to act exactly like the built in lists, but appends and finding the tail elemeent are O(1).

It doesn't seem possible to make this as convenient as the built in list, since :: doesn't seem to be redefinable, and I don't know how you'd make this work in pattern matching.  Is there any work on making user defined abstract types work in pattern matching?

Chris


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr