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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 2A24CBB9A for ; Fri, 28 Oct 2005 11:56:50 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9S9unF2019470 for ; Fri, 28 Oct 2005 11:56:49 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA17074 for ; Fri, 28 Oct 2005 11:56:49 +0200 (MET DST) Received: from imag.imag.fr (imag.imag.fr [129.88.30.1]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j9S9umd9027525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 28 Oct 2005 11:56:48 +0200 Received: from [147.171.255.214] (mac-clerc.imag.fr [147.171.255.214]) by imag.imag.fr (8.13.0/8.13.0) with ESMTP id j9S9ukp2016225 for ; Fri, 28 Oct 2005 11:56:46 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v734) Content-Transfer-Encoding: 7bit Message-Id: <589B1E9E-D4EC-4E03-9375-30670ED82BEB@free.fr> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: caml-list@inria.fr From: Xavier Clerc Subject: Question about polymorphic variants Date: Fri, 28 Oct 2005 11:57:26 +0200 X-Mailer: Apple Mail (2.734) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (imag.imag.fr [129.88.30.1]); Fri, 28 Oct 2005 11:56:46 +0200 (CEST) X-IMAG-MailScanner: Found to be clean X-IMAG-MailScanner-Information: Please contact the ISP for more information X-j-chkmail-Score: MSGID : 4361F5E0.000 on concorde : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 4361F5E1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4361F5E0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; variants:01 variants:01 inference:01 ocaml:01 val:01 stack:01 stack:01 polymorphic:01 polymorphic:01 expression:01 expression:01 define:01 int:01 int:01 underscore:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Hello, I have a question concerning polymorphic variants and type inference. Formulating my question from the example of section 4.2 in the ocaml manual (version 3.08), I define a function f: let f = function | `On -> 1 | `Off -> 0 which is inferred as: val f : [< `Off | `On ] -> int Then, I use this function in the following expression : List.map f which is in turn inferred as: _[< `Off | `On ] list -> int list My question is about the meaning of the leading underscore in the inferred type (given that I understand the meaning of the underscore in an expression such as "Stack.create ()" that is inferred as: '_a Stack.t). Regards, Xavier Clerc