From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 0291EBC37 for ; Wed, 29 Jul 2009 00:18:40 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuECADMWb0rUnwdkbGdsb2JhbACCIJdnDQgNBxEGu0qEEAU X-IronPort-AV: E=Sophos;i="4.43,284,1246831200"; d="scan'208";a="31817957" Received: from relay.pcl-ipout02.plus.net ([212.159.7.100]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 29 Jul 2009 00:18:40 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAAYWb0rUnw4S/2dsb2JhbACCINNthBAF Received: from pih-relay05.plus.net ([212.159.14.18]) by relay.pcl-ipout02.plus.net with ESMTP; 28 Jul 2009 23:18:40 +0100 Received: from [87.115.75.10] (helo=leper.local) by pih-relay05.plus.net with esmtp (Exim) id 1MVv0J-0007eg-Og for caml-list@yquem.inria.fr; Tue, 28 Jul 2009 23:18:39 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] annotations and type-checking Date: Wed, 29 Jul 2009 00:28:29 +0100 User-Agent: KMail/1.9.9 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907290028.29488.jon@ffconsultancy.com> X-Plusnet-Relay: a5ea98dfce8da33a7799659508ede615 X-Spam: no; 0.00; annotations:01 bool:01 bool:01 2009:98 harmless:98 frog:98 wrote:01 caml-list:01 int:01 int:01 expression:02 annotation:02 latter:03 let:03 let:03 On Tuesday 28 July 2009 22:47:25 Aaron Bohannon wrote: > let f (x : 'a) : 'a = x in (f true, f 3);; Err, good question. :-) # let f : _ = fun x -> x in f true, f 3;; - : bool * int = (true, 3) # let f : 'a = fun x -> x in f true, f 3;; Error: This expression has type int but is here used with type bool I'm guessing the scope of the 'a is not what you'd expect but I have no idea why. I'd have thought the latter would be a harmless type annotation... Any takers? -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e