Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] simple typing question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Francois Pottier <francois.pottier@i...>
Subject: Re: [Caml-list] simple typing question

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