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
Unexpected '_a problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-08-02 (08:05)
From: Andreas Rossberg <AndreasRossberg@w...>
Subject: Re: [Caml-list] Unexpected '_a problem
Christophe Dehlinger wrote:
>On 8/2/06, Remi Vanicat < > wrote:
>>2006/8/1, Andreas Rossberg <>:
>> This has nothing to do with contravariance, nor with subtyping or objects
>> all. What you observe is the infamous "value restriction": roughly, a
>> definition can only be polymorphic when its right-hand side is
>> a value (i.e. a function, tuple, constant, etc or combination thereof).
>> your case it's an application.
>This is Wright's value restriction, that is used in SML (maybe in Alice ML
too ?).
>OCaml uses Garrigue's relaxed value restriction, which does care about
>(see ).
>I haven't read that paper recently, but IIRC Garrigue's value restriction
>generalisation of some of the type parameters that are in covariant

Oops, right, somehow I had forgotten about the relaxation. Thanks to you and
Alain for the correction.

- Andreas