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 WAA09293; Wed, 29 Sep 2004 22:48:12 +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 WAA08198 for ; Wed, 29 Sep 2004 22:48:11 +0200 (MET DST) Received: from relaissmtp.ens-lyon.fr (pluvier.ens-lyon.fr [140.77.167.5]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i8TKmBXK003707 for ; Wed, 29 Sep 2004 22:48:11 +0200 Received: from mouette.ens-lyon.fr ([140.77.167.4]) by relaissmtp.ens-lyon.fr with esmtp (Exim 3.35 #1 (Debian)) id 1CClMx-0003Zx-00 for ; Wed, 29 Sep 2004 22:48:11 +0200 Received: by mouette.ens-lyon.fr (Postfix, from userid 33) id 5610B3C61C2; Wed, 29 Sep 2004 22:48:11 +0200 (CEST) To: caml-list Subject: Re: [Caml-list] really HO Functions Message-ID: <1096490891.415b1f8b2ecbd@mouette.ens-lyon.fr> Date: Wed, 29 Sep 2004 22:48:11 +0200 (CEST) From: Jean-Baptiste Rouquier MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: IMP/PHP IMAP webmail program 2.2.6 X-Originating-IP: 80.9.153.12 X-Miltered: at concorde with ID 415B1F8B.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 ens-lyon:01 behaviour:01 ast:02 nested:02 module:03 unit:03 unit:03 string:03 wrote:03 library:03 argument:03 argument:03 arguments:03 override:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Radu Grigore wrote: >For this message I'll classify functions on "levels" based on how many >nested parenthesis are needed to represent their type. (...) > >My question is: are there functions of level >= 2 used in practice >(e.g. (('a -> 'b -> 'a) -> 'a -> 'b list -> 'a) -> 'c)? In my soon-to-be-released library to read and write configuration files, I have one example of this. Basically, the function reading a file (actually a method) has on optional argument that allows the user to override the default behaviour in case there is an error. The argument is itself a function that get all the available information as arguments, including a value of type (out_channel -> unit) that pretty print (with module Format) a part of the read AST to the given output channel. So I have method read : ... -> ... -> ?on_type_error : (... -> ... -> (out_channel -> unit) -> ... -> unit) -> string -> unit Out of curiosity, may I ask why you're looking for such functions ? Regards, -- Jean-Baptiste Rouquier ------------------- 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