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=AWL,HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 049DCBC69 for ; Thu, 18 Oct 2007 16:22:35 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAAwJF0dCm3xr/2dsb2JhbACCPTU X-IronPort-AV: E=Sophos;i="4.21,295,1188770400"; d="scan'208,217";a="3197776" Received: from janestcapital.com (HELO smtp.janestcapital.com) ([66.155.124.107]) by mail1-smtp-roc.national.inria.fr with ESMTP; 18 Oct 2007 16:22:34 +0200 Received: from [172.25.129.161] [38.96.172.125] by janestcapital.com with ESMTP (SMTPD-9.10) id AC2904D8; Thu, 18 Oct 2007 10:22:33 -0400 Message-ID: <47176C28.1090509@janestcapital.com> Date: Thu, 18 Oct 2007 10:22:32 -0400 From: Brian Hurt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Help me find this pdf References: <200710181325.30668.jon@ffconsultancy.com> <20071018.214610.22513172.garrigue@math.nagoya-u.ac.jp> <200710181457.58077.jon@ffconsultancy.com> In-Reply-To: <200710181457.58077.jon@ffconsultancy.com> Content-Type: multipart/alternative; boundary="------------050004080608050207060101" X-Spam: no; 0.00; haskell:01 fpls:01 iirc:01 ocaml:01 verbose:01 ocaml:01 haskell:01 fpls:01 iirc:01 verbose:01 3.1:98 3.1:98 prolog:01 prolog:01 wrote:01 This is a multi-part message in MIME format. --------------050004080608050207060101 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Jon Harrop wrote: >On Thursday 18 October 2007 13:46:10 you wrote: > > >>From: Jon Harrop >> >> >>>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. >> >> > >How do you pattern match over lazy values in OCaml? If I've missed that, it >would be really cool to find out! :-) > > > You have to explicitly force the lazy value first- but other than it being explicit, this is no different from other languages that implicitly force the value for you. Well, Haskell has an option where a pattern match can always succeed that doesn't necessarily force the lazy value (I forget what it's called at the moment), but baring that, even standard Haskell pattern matching forces the value for the match. Brian --------------050004080608050207060101 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Jon Harrop wrote:
On Thursday 18 October 2007 13:46:10 you wrote:
  
From: Jon Harrop <jon@ffconsultancy.com>
    
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.
    

How do you pattern match over lazy values in OCaml? If I've missed that, it 
would be really cool to find out! :-)

  
You have to explicitly force the lazy value first- but other than it being explicit, this is no different from other languages that implicitly force the value for you.  Well, Haskell has an option where a pattern match can always succeed that doesn't necessarily force the lazy value (I forget what it's called at the moment), but baring that, even standard Haskell pattern matching forces the value for the match.

Brian

--------------050004080608050207060101--