caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Harrison, John R" <johnh@ichips.intel.com>
To: "caml-list" <caml-list@inria.fr>
Cc: "Harrison, John R" <johnh@ichips.intel.com>
Subject: RE: [Caml-list] really HO Functions
Date: Thu, 30 Sep 2004 10:30:50 -0700	[thread overview]
Message-ID: <012676D607FCF54E986746512C22CE7D0FE7AD@orsmsx407> (raw)

| 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.

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 >= 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

-------------------
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


             reply	other threads:[~2004-09-30 17:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-30 17:30 Harrison, John R [this message]
2004-10-04 11:13 ` [Caml-list] Wierd behavior of file reading when tried to start an executable in Ocaml code Andy Yang
2004-10-04 11:28   ` Keith Wansbrough
2004-10-04 12:40   ` skaller
  -- strict thread matches above, loose matches on Subject: below --
2004-09-29 20:48 [Caml-list] really HO Functions Jean-Baptiste Rouquier
2004-10-02  5:02 ` Radu Grigore
2004-10-02  6:33   ` John Prevost
2004-10-02 16:44     ` Seth J. Fogarty
2004-09-29 18:48 Radu Grigore
2004-09-29 19:24 ` Jacques Carette
2004-09-29 22:31 ` Jon Harrop
2004-09-29 23:32   ` Marcin 'Qrczak' Kowalczyk
2004-09-30  6:27     ` Diego Olivier Fernandez Pons
2004-09-30 19:27 ` Michal Moskal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=012676D607FCF54E986746512C22CE7D0FE7AD@orsmsx407 \
    --to=johnh@ichips.intel.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).