From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA14597; Thu, 30 Sep 2004 19:30:56 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA19860 for ; Thu, 30 Sep 2004 19:30:53 +0200 (MET DST) Received: from orsfmr001.jf.intel.com (fmr12.intel.com [134.134.136.15]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i8UHUqDE015013 for ; Thu, 30 Sep 2004 19:30:53 +0200 Received: from talaria.jf.intel.com (talaria.jf.intel.com [10.7.209.7]) by orsfmr001.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.15 2004/01/30 18:16:28 root Exp $) with ESMTP id i8UHV64U027730 for ; Thu, 30 Sep 2004 17:31:06 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by talaria.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.11 2004/07/29 22:51:53 root Exp $) with SMTP id i8UHMWXC002248 for ; Thu, 30 Sep 2004 17:22:36 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004093010305115025 for ; Thu, 30 Sep 2004 10:30:51 -0700 Received: from orsmsx407.amr.corp.intel.com ([192.168.65.50]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 30 Sep 2004 10:30:51 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [Caml-list] really HO Functions Date: Thu, 30 Sep 2004 10:30:50 -0700 Message-ID: <012676D607FCF54E986746512C22CE7D0FE7AD@orsmsx407> Thread-Topic: [Caml-list] really HO Functions Thread-Index: AcSmdO7Vuen8hdBtRya76y4UkQ2SaQAnPGgA From: "Harrison, John R" To: "caml-list" Cc: "Harrison, John R" X-OriginalArrivalTime: 30 Sep 2004 17:30:51.0118 (UTC) FILETIME=[3B1CD8E0:01C4A713] X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-Miltered: at nez-perce with ID 415C42CC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 johnh:01 unmanageable:01 2004:99 caml-list:01 2004:99 usefulness:01 generic:01 bug:01 faq:01 faq:01 beginner's:01 beginners:01 bin:01 caml-bugs:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk | I've just had a look through some real programs that I've written and the=20 | answer is definitely yes. I use them quite a lot. For >2 they are mainly 3,=20 | sometimes 4 and I haven't seen any >4. I haven't actually checked, but I suspect I'd find something similar. There may be an interesting psychological observation to be made here: most people find very high-order functions intellectually unmanageable. Something similar is usually acknowledged in logic with respect to long quantifier alternations (for all x there exists a y such that for all z, ...). I believe I once saw a provocative claim by Kreisel that most mathematical concepts are in fact only invented in order to hide complicated quantifier alternations. John. -----Original Message----- From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml-list@pauillac.inria.fr] On Behalf Of Jon Harrop Sent: Wednesday, September 29, 2004 3:31 PM To: caml-list Subject: Re: [Caml-list] really HO Functions On Wednesday 29 September 2004 19:48, Radu Grigore wrote: > My question is: are there functions of level >=3D 2 used in practice > (e.g. (('a -> 'b -> 'a) -> 'a -> 'b list -> 'a) -> 'c)? I've just had a look through some real programs that I've written and the=20 answer is definitely yes. I use them quite a lot. For >2 they are mainly 3,=20 sometimes 4 and I haven't seen any >4. > If so, are=20 > there any typical ones that appear in many applications (maybe not as > widespread like map & company but at least of comparable usefulness)? I seem to use them when I write generic functions which are later specialised. > One example of a level 2 function (stolen from a recent post by Jon > Harrop) is this: > let sum fold =3D fold (+);; Funny to think that this function is still state-of-the-art Java and C++. ;-) Cheers, Jon. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners