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.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 1DA3CBC69 for ; Thu, 18 Oct 2007 14:46:33 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAH3yFkeCNhAB/2dsb2JhbAA X-IronPort-AV: E=Sophos;i="4.21,295,1188770400"; d="scan'208";a="4711784" Received: from kurims.kurims.kyoto-u.ac.jp ([130.54.16.1]) by mail3-smtp-sop.national.inria.fr with ESMTP; 18 Oct 2007 14:46:31 +0200 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.8/8.13.8) with ESMTP id l9ICkNJ5001709; Thu, 18 Oct 2007 21:46:23 +0900 (JST) Date: Thu, 18 Oct 2007 21:46:10 +0900 (JST) Message-Id: <20071018.214610.22513172.garrigue@math.nagoya-u.ac.jp> To: jon@ffconsultancy.com Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Help me find this pdf From: Jacques Garrigue In-Reply-To: <200710181325.30668.jon@ffconsultancy.com> References: <200710181325.30668.jon@ffconsultancy.com> X-Mailer: Mew version 4.2 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; haskell:01 fpls:01 iirc:01 ocaml:01 verbose:01 datatype:01 mutable:01 3.1:98 3.1:98 prolog:01 wrote:01 caml-list:01 functions:01 functions:01 constructor:01 From: Jon Harrop > On Thursday 18 October 2007 10:52:26 Tom wrote: > > Not long ago I was searching the Internet on the topic "combining eager and > > lazy evaluation", and have run over a paper which I obviously dismissed as > > "not interesting enough", yet now I have realized that it could indeed be > > useful, but am unable to find it. > > > > I know it was talking about a useful primitive, I do not know how exactly > > it was named, which checked whether values passed as arguments to functions > > were lazy (blocks to be evaluated) or eager (already evaluated), and using > > it some functions, e.g. map (this example was present in the paper) could > > be implemented to be both eager and lazy at the same time, depending on the > > arguments. > > > > Does anyone recognize this description? > > Scala can do something similar by controlling evaluation simply by altering > the signature. However, I've reviewed Haskell recently and I think complete > laziness is more of a hindrance than a benefit. The only think I'd like to > see added to eager FPLs is the ability to pattern match over lazy values, > forcing them only when necessary. What! You want Caml V3.1 (released in 1991 IIRC)! I remember writing a lazy prolog interpreter using this feature. Lazyness in ocaml works too, but it's more verbose. Actually Caml 3.1 had only lazy fields in records. To be complete, one would like to mark as lazy any part of a datatype, like you could mark as mutable fields of a constructor in later versions of caml-light. But then I don't use lazyness in data structures very often. Jacques Garrigue