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
Imperative list operations
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stefan Monnier <monnier+lists/caml/news/@t...>
Subject: Re: Imperative list operations
>>>>> "Steve" == Steve Stevenson <> writes:
> 	I need a double-ended queue implementation. The lists
> can get very long, so I would like to use imperative operations to
> change the links.

Since my O'Caml is very approximate, I'll answer with a non-answer:
have you tried a purely functional (but asymptotically efficient)
deque ?  Those don't suffer from the length of the queue.

Chris Okasaki has an interesting set of such purely functional data-structures,
with sample code in SML (and/or Haskell) which should be easy to translate to
O'Caml.  Check out, for example