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] Polymorphic methods and ellipsis
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-09-24 (08:54)
From: Alessandro Baretta <alex@b...>
Subject: Re: [Caml-list] Polymorphic methods and ellipsis wrote:
> On Sun, 22 Sep 2002, Alessandro Baretta wrote:
>>Let me suggest another idea where you might better spend 
>>your time. I can write
>> > let f x : 'a -> 'a = x
> Does this do what you think it does? What is the type of f?
> Incidentally, I'd prefer some form of separate, forward type declaration.
> -- Brian

Nope. Right, the colon-type-equals construct is for the 
definition of the return type, as opposed the actual type of 
f. Let me then rework my suggestion as

method f (x:'a) : 'a.'a = x

which is now actually equivalent to

let f (x:'a) : 'a = x


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: