From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA29616; Thu, 15 Aug 2002 11:18:55 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA29778 for caml-list@pauillac.inria.fr; Thu, 15 Aug 2002 11:18:54 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA27166 for ; Tue, 13 Aug 2002 17:12:02 +0200 (MET DST) Received: from mail.tepkom.ru (mail.tepkom.ru [195.9.10.14]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7DFC0b10417 for ; Tue, 13 Aug 2002 17:12:00 +0200 (MET DST) Received: from youngkouzdra (max.tepkom.ru [195.19.226.43]) by mail.tepkom.ru (8.11.6/8.11.6) with SMTP id g7DFBfF01453; Tue, 13 Aug 2002 19:11:41 +0400 (MSD) (envelope-from msk@post.tepkom.ru) Message-ID: <012001c242db$ba4c9f90$2be213c3@youngkouzdra> From: "Anton Moscal" To: "Oleg" Cc: References: <200208131430.KAA23206@hickory.cc.columbia.edu> Subject: Re: [Caml-list] Doubly-linked list Date: Tue, 13 Aug 2002 19:11:40 +0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 FL-Build: Fidolook Express 2001 UIExt. BuildID: 3BC00FAD (7/10/2001 12:17:49). Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, Oleg! You wrote to "Diego Olivier Fernandez Pons" on Tue, 13 Aug 2002 10:30:59 -0400: O> Will it include imperative doubly-linked list or are all data types O> going to O> be purely functional? It's hard for me to think of an efficient O> purely functional doubly-linked list. For example: type 'a dll = 'a list (* before *) * 'a * 'a list (* next *) let ins_after elem (bef, cur, aft) = (cur::bef, elem, aft) let next = function (bef, cur, (cur'::aft)) -> Some ((cur::bef), cur', aft) | _ -> None let prev = function ((cur'::bef), cur, aft) -> Some (bef, cur', (cur::aft)) | _ -> None ... Anton Moscal. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners