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 AAA11344; Thu, 30 Sep 2004 00:35:15 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA12559 for ; Thu, 30 Sep 2004 00:35:14 +0200 (MET DST) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i8TMZD6E017685 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 30 Sep 2004 00:35:14 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay02.plus.net with esmtp (Exim) id 1CCn2W-000DTt-Ae for caml-list@inria.fr; Wed, 29 Sep 2004 22:35:12 +0000 From: Jon Harrop To: caml-list Subject: Re: [Caml-list] really HO Functions Date: Wed, 29 Sep 2004 23:31:05 +0100 User-Agent: KMail/1.6.2 References: <7f8e92aa04092911481e72dbeb@mail.gmail.com> In-Reply-To: <7f8e92aa04092911481e72dbeb@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200409292331.05016.jon@jdh30.plus.com> X-Miltered: at concorde with ID 415B38A1.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 usefulness:01 generic:01 widespread:03 wrote:03 let:04 functions:05 functions:05 cheers:06 quite:06 practice:06 maybe:06 java:07 fold:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wednesday 29 September 2004 19:48, Radu Grigore wrote: > My question is: are there functions of level >= 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 answer is definitely yes. I use them quite a lot. For >2 they are mainly 3, sometimes 4 and I haven't seen any >4. > If so, are > 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 = 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