From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 46426BB84 for ; Wed, 2 Aug 2006 10:05:00 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k7284xAQ013899 for ; Wed, 2 Aug 2006 10:04:59 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA08428 for ; Wed, 2 Aug 2006 10:04:59 +0200 (MET DST) Received: from fmmailgate02.web.de (fmmailgate02.web.de [217.72.192.227]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7284wnI030962 for ; Wed, 2 Aug 2006 10:04:59 +0200 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate02.web.de (Postfix) with ESMTP id B5EA8D263AE for ; Wed, 2 Aug 2006 10:04:58 +0200 (CEST) Received: from [84.165.135.217] (helo=wiko) by smtp05.web.de with smtp (WEB.DE 4.107 #114) id 1G8Bir-00086J-00 for caml-list@inria.fr; Wed, 02 Aug 2006 10:04:58 +0200 Message-ID: <003c01c6b60b$041f8d70$15b2a8c0@wiko> From: "Andreas Rossberg" To: "O'Caml Mailing List" References: <875c7e070608011347y62d2dd21lc55390cd4ffd00a1@mail.gmail.com><004801c6b5b0$47811030$15b2a8c0@wiko><6b8a91420608011509s696233cew8d499f315aa0cba9@mail.gmail.com> Subject: Re: [Caml-list] Unexpected '_a problem Date: Wed, 2 Aug 2006 10:07:25 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Sender: AndreasRossberg@web.de X-Sender: AndreasRossberg@web.de X-Miltered: at concorde with ID 44D05CAB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44D05CAA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; rossberg:01 christophe:01 rossberg:01 subtyping:01 sml:01 ocaml:01 variance:01 wwwfun:01 iirc:01 2006:98 wrote:01 wrote:01 polymorphic:01 caml-list:01 andreas:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 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 at >> all. What you observe is the infamous "value restriction": roughly, a >> definition can only be polymorphic when its right-hand side is syntactically >> a value (i.e. a function, tuple, constant, etc or combination thereof). In >> 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 variance >(see 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 allows >generalisation of some of the type parameters that are in covariant position. Oops, right, somehow I had forgotten about the relaxation. Thanks to you and Alain for the correction. - Andreas