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=1.2 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 61D55BC69 for ; Fri, 9 Mar 2007 10:32:24 +0100 (CET) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l299WNkd004468 for ; Fri, 9 Mar 2007 10:32:24 +0100 Received: by nf-out-0910.google.com with SMTP id a27so953631nfc for ; Fri, 09 Mar 2007 01:32:23 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=mhZlK4ClmRxvP+ikP1SZ8eZGgp3mrfgRYsXxTQ2qxw7WDr3fPglWodjq3VAhOX2gvAiJP+JZy1/LASbvxD9wVVRynM6GKT0gcx+KpWOZup7m03XXjOTQfiDyaPFPLGllbG/8J7XAf4g2/jN6g1UK/2hrvsb3dvdztpaQA3xS//k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=sFNaCKmKHR69tuU86XJHqzC1KhGa9Ns5W90dgQWs6ZxGvDi9t3twNvTAUJfA3NMljBHkf46eevesMjGHcEVp5R54MqHU6ZRr/r08iC9o+L6C1ZeMt5Dprp5T79WIqjH2tzMQQIkhKY6VWDaVkW60LBe4LlwbCFwXp/EgfhkFEWU= Received: by 10.82.108.9 with SMTP id g9mr2338233buc.1173432743587; Fri, 09 Mar 2007 01:32:23 -0800 (PST) Received: by 10.82.100.16 with HTTP; Fri, 9 Mar 2007 01:32:23 -0800 (PST) Message-ID: Date: Fri, 9 Mar 2007 10:32:23 +0100 From: Tom To: skaller Subject: Re: [Caml-list] Operator overloading Cc: caml-list@yquem.inria.fr, "Robert Fischer" In-Reply-To: <1173432251.22738.2.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_214627_26204401.1173432743546" References: <3D1E4D9CA9BCE04D8F2B55F203AE4CE30666AB74@selma.roomandboard.com> <1173397864.6613.49.camel@rosella.wigram> <1173432251.22738.2.camel@rosella.wigram> X-j-chkmail-Score: MSGID : 45F129A7.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45F129A7.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; overloading:01 elt:01 typeclass:01 elt:01 snake:98 snake:98 sourceforge:01 sourceforge:01 wrote:01 wrote:01 caml-list:01 define:01 define:01 defined:02 defined:02 X-Attachments: cset="UTF-8" cset="UTF-8" ------=_Part_214627_26204401.1173432743546 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 09/03/07, skaller wrote: > > > Actually, length can be defined in turns of fold: > > let len x = fold (fun acc elt -> acc + 1) 0 container > Yes, as long as x is a container. But how are you going to define a length of a snake using fold? Basically, I agree with you. I'm just saying that you can further increase the "typeclass" of length-able objects to almost anything. Why limit ourselves? - Tom ------=_Part_214627_26204401.1173432743546 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline
On 09/03/07, skaller <skaller@users.sourceforge.net> wrote:

Actually, length can be defined in turns of fold:

let len x = fold (fun acc elt -> acc + 1) 0 container

Yes, as long as x is a container. But how are you going to define a length of a snake using fold?

Basically, I agree with you. I'm just saying that you can further increase the "typeclass" of length-able objects to almost anything. Why limit ourselves?

- Tom
------=_Part_214627_26204401.1173432743546--