Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2002-07-03 (07:51)
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
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: