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 OAA02566; Wed, 23 Apr 2003 14:29:03 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA02708 for ; Wed, 23 Apr 2003 14:29:02 +0200 (MET DST) Received: from mailhost.tni.fr (firewall.tni.fr [195.25.255.61]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h3NCT1H03606 for ; Wed, 23 Apr 2003 14:29:01 +0200 (MET DST) Received: from groscool.tni.fr ([195.25.255.1]) by mailhost.tni.fr (Netscape Messaging Server 3.62) with SMTP id 231; Wed, 23 Apr 2003 14:28:44 +0200 Received: from 192.168.7.60 by groscool.tni.fr (InterScan E-Mail VirusWall NT); Wed, 23 Apr 2003 14:28:43 +0200 (Paris, Madrid (heure d'été)) Message-ID: <3EA685EA.9AA4DF93@tni.fr> Date: Wed, 23 Apr 2003 14:24:10 +0200 From: "sebastien FURIC" X-Mailer: Mozilla 4.78 [fr] (Windows NT 5.0; U) X-Accept-Language: fr MIME-Version: 1.0 To: sebastien FURIC CC: SooHyoung Oh , OCaml Mailing list Subject: Re: [Caml-list] fib with lazy list References: <003901c30986$92677ff0$fe00a8c0@hama> <3EA6827C.64D3D22@tni.fr> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; furic:01 tni-valiosys:01 caml-list:01 failwith:01 ecrit:01 lazy:02 sebastien:03 let:04 cheers:06 solves:06 type:07 problem:07 function:09 U5:88 force:11 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Sorry, a typo: sebastien FURIC a écrit : > > The following code solves your problem: > > type 'a llist = LList of 'a * 'a llist Lazy.t | Empty > > let tl = function > | Empty -> failwith "tl: empty list" > | LList (_, xs) -> xs ^^^^^^^^^^^^^^^^^^^^^ | LList (_, lxs) -> Lazy.force lxs Cheers, Sebastien. ------------------- 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