From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q2MDdXwn006325 for ; Thu, 22 Mar 2012 14:39:33 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBAE4ra0/RVdY2kGdsb2JhbABDhUixbwgiAQEBAQkJDQcUBCOCCQEBAQQSAg8ECwEFCAEbHAEBAwwGBQsNAgIFFggDAgIJAwIBAgEREQEFAQsRBg0BBQIBAR6HaKB8CotIToJxhRw/gQ4BBQuBJI4fgRYElV+FbYhcPYQK X-IronPort-AV: E=Sophos;i="4.73,630,1325458800"; d="scan'208";a="150720197" Received: from mail-bk0-f54.google.com ([209.85.214.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 22 Mar 2012 14:39:24 +0100 Received: by bkcjc3 with SMTP id jc3so3248912bkc.27 for ; Thu, 22 Mar 2012 06:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=P3Pw9SIRC8k7Ec9GJieRhsQ0s2wrHzDqV2UP1+i6scI=; b=qquitbOT1LmsTlrkMqLMMVKuMyrUlkOLfyMWjaODVVo9qv7vT2CdLAZg8K4vy59kc+ y6Y9mXDHHiAEmDhz/VNt53LQzGRcB4QCV90ZMC8nj/WfXt2Q1BCD4BWoYhY7clJwQ7at R++bPPp3xJBMeAXtBGD4BWrPjMjFlidf+C1YCPSpZHo6/RwJJanDckJNuScnOojXgvhX /enrb/ddZtzz49AnCEOJGzzKbciZywGbuPdd4RLqwjCnSWUc3tgEio2NzF+B6Q8LE1Sd H6brK40BynzJiLclu/lJmcZ6Y9SUS6ebhuQwEHSovc6/EAjW8heOZWLzyne+j1bOFZBH kCuA== Received: by 10.204.154.10 with SMTP id m10mr2943696bkw.13.1332423563785; Thu, 22 Mar 2012 06:39:23 -0700 (PDT) Received: from [128.93.11.91] (sauternes.inria.fr. [128.93.11.91]) by mx.google.com with ESMTPS id z17sm1464294bkw.12.2012.03.22.06.39.22 (version=SSLv3 cipher=OTHER); Thu, 22 Mar 2012 06:39:22 -0700 (PDT) Message-ID: <4F6B2B83.3070003@gmail.com> Date: Thu, 22 Mar 2012 14:39:15 +0100 From: Jonathan Protzenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120321 Thunderbird/14.0a1 MIME-Version: 1.0 To: Julien Signoles CC: caml-list@inria.fr, Roberto Di Cosmo References: <20120322095143.GA30016@voyager> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Funny name for a type variable in the output: should this be filed on the BTS? Jacques Garrigue recently implemented a patch that tries to keep user-provided type names when printing out types, and also when giving error messages. In your example, there probably is an internal variable that's called "a" because of the type name you provided. Some wizardry happens with GADTs, so another type variable is generated. The other one ends up being printed, and because it's called "a" too, the type-checker has to find another suitable name. Or something like that. Maybe change type a b. to type foo bar. will give different results :). Cheers, jonathan On Thu 22 Mar 2012 01:05:08 PM CET, Julien Signoles wrote: > Hello, > > Le 22 mars 2012 10:51, Roberto Di Cosmo > a écrit : > > val length : ('a1, 'b) l -> int = > > Why do we get 'a1, and not 'a, in the type? > > Well, probably, since 'a is instantiated to int during > type checking, it may be the case that 'a, as type name, is > still marked as taken during the type output, so we get ('a1,'b) > > The type is perfectly sound... it is just 'surprising' for > a regular user... do you think this should be considered a bug? > > > IMHO it is not a bug (as you said, the type is sound), but you could > write a feature request like "generate variable name as best as > possible"... > > -- > Julien