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=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 29647BBAF for ; Tue, 25 Aug 2009 00:06:41 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHSrkkpeFxRU/2dsb2JhbADXIYQaBQ X-IronPort-AV: E=Sophos;i="4.44,267,1249250400"; d="scan'208";a="45097503" Received: from glyptal.glondu.net ([94.23.20.84]) by mail4-smtp-sop.national.inria.fr with ESMTP; 25 Aug 2009 00:06:41 +0200 Received: from [10.198.42.2] (unknown [10.198.42.2]) by glyptal.glondu.net (Postfix) with ESMTP id A69A859E75; Tue, 25 Aug 2009 00:08:28 +0200 (CEST) Message-ID: <4A930EF0.3050900@glondu.net> Date: Tue, 25 Aug 2009 00:06:40 +0200 From: =?UTF-8?B?U3TDqXBoYW5lIEdsb25kdQ==?= User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Warren Harris Cc: OCaml Subject: Re: [Caml-list] lazy vs fun References: <94AD5806-B6F6-44F7-AA3C-1E63B6C1A722@metaweb.com> In-Reply-To: <94AD5806-B6F6-44F7-AA3C-1E63B6C1A722@metaweb.com> X-Enigmail-Version: 0.95.0 OpenPGP: id=FCE03DAA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; ocaml:01 cheers:01 phane:98 steph:98 warren:98 phane:98 caml-list:01 int:01 int:01 lazy:02 lazy:02 unit:03 pattern:04 perhaps:05 matching:05 Warren Harris a =C3=A9crit : > Is there any advantage to using lazy evaluation in ocaml rather than > just using thunks to defer evaluation? [...] Two things I can think of right now: they are evaluated only once (even if you call Lazy.force several times), and you can do pattern matching with them. > Perhaps it's just that the type int lazy_t is more informative than uni= t -> int? That one, too. Cheers, --=20 St=C3=A9phane