From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SUBJECT_EXCESS_QP autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 763AABC69 for ; Wed, 21 Mar 2007 02:06:03 +0100 (CET) Received: from sys18.mail.msu.edu (sys18.mail.msu.edu [35.9.75.118]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2L162Zk007490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 21 Mar 2007 02:06:03 +0100 Received: from shawjef3 by sys18.mail.msu.edu with local (Exim 4.52 #1) id 1HTpH7-0002er-Fg for caml-list@inria.fr; Tue, 20 Mar 2007 21:06:01 -0400 References: <4000A41B-9DE0-42A5-A25B-44F98F7D27DD@epfl.ch> In-Reply-To: <4000A41B-9DE0-42A5-A25B-44F98F7D27DD@epfl.ch> From: "Jeffrey Loren Shaw" To: caml-list@inria.fr Subject: Re: [Caml-list] possible way to improve =?utf-8?Q?=22lazy=22?= Date: Tue, 20 Mar 2007 21:06:01 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: X-Virus: None found by Clam AV X-Miltered: at concorde with ID 460084FA.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; posts:01 parser:01 caml-list:01 lazy:02 lazy:02 caml:02 caml:02 element:03 imo:04 guess:04 daniel:04 quite:07 streams:07 streams:07 looks:08 Daniel, Thanks for that link! It looks like this has been discussed at some length. Well hm, I guess consider my post a request for renewed effort on this front. Lazy evaluation can be very useful, and since caml already supports it, it'd be nice if it were easier to use. Zheng Li, Yes that's exactly what I'm asking for! It'd be really cool to have in caml IMO. type 'a t = 'a * 'a t Lazy.t;; This will work for infinite lists, but there is no empty list, so it's not quite a proper lazy list. And streams aren't right either, because they are destructive. If you ask for the 3rd element on a lazy list, you can still ask for the 1st and 2nd elements, whereas streams are unable to recover the previous values. This has its applications but it's not the same as a list. Thanks for the posts! I'll keep plugging away to try and get my combinatorial parser to work perfectly lazy. I'm close but I'm having trouble with sequencing. Jeff