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 JAA04398; Wed, 3 Jul 2002 09:51:33 +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 JAA04333 for ; Wed, 3 Jul 2002 09:51:33 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g637pW911327 for ; Wed, 3 Jul 2002 09:51:32 +0200 (MET DST) Received: (from fpottier@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA04225 for caml-list@inria.fr; Wed, 3 Jul 2002 09:51:32 +0200 (MET DST) Date: Wed, 3 Jul 2002 09:51:31 +0200 From: Francois Pottier To: caml-list@inria.fr Subject: Re: [Caml-list] simple typing question Message-ID: <20020703095131.A3909@pauillac.inria.fr> Reply-To: Francois.Pottier@inria.fr References: <200207022059.WAA29845@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0i In-Reply-To: ; from pixel@mandrakesoft.com on Wed, Jul 03, 2002 at 02:39:02AM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Jul 03, 2002 at 02:39:02AM +0200, Pixel wrote: > > based on the number of parameters of functions (given by the type). There is no such thing as the `number of parameters of a function' in ML. Consider the following example: # let apply f x = f x;; val apply : ('a -> 'b) -> 'a -> 'b = # apply (fun x -> x) 1;; - : int = 1 # apply (fun x y -> x + y) 1 2;; - : int = 3 ... and so on. You can write applications of `apply' with any numbers of arguments. Its type doesn't help, because it ends with a quantified type variable 'b, which can be instantiated with an arrow type of arbitrary length. Besides, your restriction amounts to preventing functions from returning functions, which doesn't make much sense in a functional language, in my opinion. Jacques has given other arguments. -- François Pottier Francois.Pottier@inria.fr http://pauillac.inria.fr/~fpottier/ ------------------- 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