From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id C67491E5 for ; Sat, 21 Apr 2018 08:42:05 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.49,306,1520895600"; d="scan'208";a="323897340" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 21 Apr 2018 10:42:04 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 5174382446; Sat, 21 Apr 2018 10:42:04 +0200 (CEST) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 6435C8240C for ; Sat, 21 Apr 2018 10:41:31 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=romain@bardou.fr; spf=Pass smtp.mailfrom=romain@bardou.fr; spf=None smtp.helo=postmaster@20.mo5.mail-out.ovh.net IronPort-PHdr: =?us-ascii?q?9a23=3AJJ6isRwQQg8xodPXCy+O+j09IxM/srCxBDY+r6Qd?= =?us-ascii?q?1OweIJqq85mqBkHD//Il1AaPAd2Araocw8Pt8InYEVQa5piAtH1QOLdtbDQizf?= =?us-ascii?q?ssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1?= =?us-ascii?q?JuPoEYLOksi7ze+/94HdbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeu?= =?us-ascii?q?BWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbO?= =?us-ascii?q?SxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsLxUb05Vzav4qlyRBP0hy?= =?us-ascii?q?oMKjo1/WHLhsB1iq9QvRCvqAFlw4PMfo+bNOdwcKDTc9wUSmVOQslfWjddAo6+?= =?us-ascii?q?dYYDE/YNMOhaooT7ulAArQG+BQ6pBO731jFIgXr20rc70+QnDArLwRYvH8gTv3?= =?us-ascii?q?TTsdX+KaAfUfqyzKnN1zrDbvVW1Czm54fSaBAuvPaMXa9qfcrf00kiDgXIhUie?= =?us-ascii?q?p4ziOjOazOUNs26D4uphU+KvkW8npBtrrjih3MchjJTCiIENyl3c8Sh13Zw5Kc?= =?us-ascii?q?CmREJme9KpEJtduzuEO4Z4Rs4uW2VltDogxrEbpJK3YDIGxZokyhLFdvCLbYiF?= =?us-ascii?q?7xT+X+iLOzh4nmhqeLenihay70egzur8W9Gq3FpWtCZFl97Mu3AX2xzW8MeHS/?= =?us-ascii?q?998l6m2TaSywDf8OZEIV40labBLZ4u3KIwmoISsUTFACD2hF37gauLekk+5+Sk?= =?us-ascii?q?9fnrbq/mq5KcLYN4lA/zP6A2lsy6G+s4MwwOX2aB+eS70b3u5Vf5QLJPjvIsk6?= =?us-ascii?q?nZtovXKt8Bqa6jHgBV1Zsj5wyxDze8yNgYh2UILEpZeBKbiIjkI03BL+r9Dfe7?= =?us-ascii?q?mlislDZrx+vaPrD6GZXMLn3DkK/7crpn6k5czhAzzdFF6J5OBLEBOqG7Zkikv9?= =?us-ascii?q?XdClo9Mheo6+fhEtR0kI0ECkyVBarMCqTXuF6OrsgmOeWLecdBojH4Ivkjz/Tn?= =?us-ascii?q?l3M+hBkTZ//6jtMsdHmkE6E+cA2ian32j4JcST5b7Dp7d/TjjRi5aRAWYn+zW6?= =?us-ascii?q?wm4TRiUdCsBJ3PQZ3rjqbThX7nTK0TXXhPDxW3KVmtb5+NAq5eYiuILsh81DIe?= =?us-ascii?q?B+D4Ft0RkCq2vQq/8IJJa+rZ/ipC6MC5jJ5w4LCVkBgz8XlzEtjb1H+NCWd5gj?= =?us-ascii?q?FQSg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CLAQB8+Npah+83eVtbhFUDdyiDapZFg?= =?us-ascii?q?TiUdQslhwsZBwEENBQBAgEBAQEBAQEBARMBAQEIDQkIKCMMgjUMDIJaJQQRdgI?= =?us-ascii?q?mAmwIAQGFDwulNIFpM4RYg3CCLoEJiRCBMoIzgzsLA4IrgjSCVAKHNZA+CHBFh?= =?us-ascii?q?CeIXgZdVzuFWyKEYok2hnaBJTOBczMaCB8RO4JDCYIlhQyJFm0BkAABAQ?= X-IPAS-Result: =?us-ascii?q?A0CLAQB8+Npah+83eVtbhFUDdyiDapZFgTiUdQslhwsZBwE?= =?us-ascii?q?ENBQBAgEBAQEBAQEBARMBAQEIDQkIKCMMgjUMDIJaJQQRdgImAmwIAQGFDwulN?= =?us-ascii?q?IFpM4RYg3CCLoEJiRCBMoIzgzsLA4IrgjSCVAKHNZA+CHBFhCeIXgZdVzuFWyK?= =?us-ascii?q?EYok2hnaBJTOBczMaCB8RO4JDCYIlhQyJFm0BkAABAQ?= X-IronPort-AV: E=Sophos;i="5.49,306,1520895600"; d="scan'208";a="262848488" Received: from 20.mo5.mail-out.ovh.net ([91.121.55.239]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Apr 2018 10:41:30 +0200 Received: from player770.ha.ovh.net (unknown [10.109.108.51]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id 02F901A2AC0 for ; Sat, 21 Apr 2018 10:41:29 +0200 (CEST) Received: from [192.168.1.15] (LFbn-1-6077-125.w90-110.abo.wanadoo.fr [90.110.38.125]) (Authenticated sender: romain@bardou.fr) by player770.ha.ovh.net (Postfix) with ESMTPSA id D5DD9C007C for ; Sat, 21 Apr 2018 10:41:29 +0200 (CEST) To: caml-list@inria.fr From: Romain Bardou Message-ID: <2a9e479f-4ce0-fdf3-d0b7-501398691720@bardou.fr> Date: Sat, 21 Apr 2018 10:41:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 17958384991149705503 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 50 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtgedrjeelgddtkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecuogetfeejfedqtdegucdlhedtmd X-Validation-by: romain@bardou.fr Subject: [Caml-list] Why doesn't relaxed value restriction apply here? Reply-To: Romain Bardou X-Loop: caml-list@inria.fr X-Sequence: 16835 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hello, According to the manual (http://caml.inria.fr/pub/docs/manual-ocaml/polymorphism.html) and to the paper "Relaxing the Value Restriction" (http://caml.inria.fr/pub/papers/garrigue-value_restriction-fiwflp04.pdf), the relaxed value restriction allows to generalize type variables which only appear in covariant positions. The following code : let f = let _ = ref 0 in fun f -> f [] returns the following in the toplevel: val f : ('_a list -> '_b) -> '_b = In this type, '_a only appears in covariant position. So, why is it not generalized? Sorry if this has been asked already, I could not find anything. I'm sure there is a simple explanation. I can't find out whether: - I'm stupid and '_a actually appears in a non-covariant position; - I'm stupid and read the rule about relaxed value restriction wrong; - or the relaxed value restriction which was implemented is not actually the one which is described in the manual and in the paper. Cheers, -- Romain Bardou -- Caml-list mailing list. Subscription management and archives: https://sympa.inria.fr/sympa/arc/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs