English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 <remi.vanicat@gmail.com > wrote:
>>2006/8/1, Andreas Rossberg <AndreasRossberg@web.de>:
>> 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
http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/papers/morepoly-long.pdf ).
>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