From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p07HLXm6003415 for ; Fri, 7 Jan 2011 18:21:33 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjgCAKXYJk3B/BfUkWdsb2JhbACDd6BHAQIJCwoHEQMhrhSNOoEhgzd0BIsJgx4 X-IronPort-AV: E=Sophos;i="4.60,290,1291590000"; d="scan'208";a="84642315" Received: from msa03.smtpout.orange.fr (HELO msa.smtpout.orange.fr) ([193.252.23.212]) by mail4-smtp-sop.national.inria.fr with ESMTP; 07 Jan 2011 18:21:27 +0100 Received: from [192.168.1.63] ([81.249.115.41]) by mwinf5d26 with ME id shMS1f00N0tfl5M03hMT66; Fri, 07 Jan 2011 18:21:27 +0100 Message-ID: <4D274B9D.5000000@frisch.fr> Date: Fri, 07 Jan 2011 18:21:33 +0100 From: Alain Frisch User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Dario Teixeira CC: caml-list@inria.fr References: <699537.6718.qm@web111509.mail.gq1.yahoo.com> In-Reply-To: <699537.6718.qm@web111509.mail.gq1.yahoo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Purity and lazyness On 01/07/2011 04:35 PM, Dario Teixeira wrote: > that is, I don't see why purity would require lazyness. I'd say that while purity certainly does not require laziness, they are a natural match: purity can benefit from laziness as an alternative to mutability in some situations. For instance, you cannot do memoization of unary functions like you would do in OCaml, using a mutable datastructure as a cache. You can pass this cache around or use a monad to maintain it, but using laziness gives a natural alternative: extend the object data structure itself with an extra slot to hold the result of the function to be memoized and you want this extra slot to be computed lazily. Alain