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=3.6 required=5.0 tests=AWL,DNS_FROM_RFC_POST, DNS_FROM_SECURITYSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 9B5D6BBAF for ; Sun, 2 Nov 2008 15:53:13 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmkBABNODUlKfS4cimdsb2JhbACTVz4BAQEKCQwHDwWpW4EAiUwBAwEDg08 X-IronPort-AV: E=Sophos;i="4.33,529,1220220000"; d="scan'208";a="19480423" Received: from yw-out-2324.google.com ([74.125.46.28]) by mail1-smtp-roc.national.inria.fr with ESMTP; 02 Nov 2008 15:53:13 +0100 Received: by yw-out-2324.google.com with SMTP id 5so849316ywb.3 for ; Sun, 02 Nov 2008 06:53:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=TMI6IPR1mjAcktM+ipwDrRwSOHzH4/oCX0URY+nGFHM=; b=EKVuxfQ5H+QcnL1n5HGSyTfuOvHbNq7iWgXdIF8AyLvBBQ0TpM6sRyM6PsTwLJYHaY t+GvTWKFTdFLqthxMef65vsTmfLGTheiUl3Q8AOKlLWu4z0RXcQoT/njWtDcMlRRKcBf QbvwxlIYaTFdo3wiuAvNOvzspl/+jKqjqfsc8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=UAqrjKw8N9O4E80AT/+gWS726z+zxGZBQHDP30qLIlR54ARpXJPzsBmgaCbsrN8C6L PHs3zzf63kQyLCBmOtnc0R+pG27hUEw4w2+zflRKrZkXSuIi5vY2TGDvfX5VeZqBBzYE XoFiIceyJDvAIKn4VDklMQIlD67oL7hn+b36c= Received: by 10.90.69.7 with SMTP id r7mr11824271aga.102.1225637592114; Sun, 02 Nov 2008 06:53:12 -0800 (PST) Received: from ?192.168.0.11? (ppp-70-242-67-240.dsl.stlsmo.swbell.net [70.242.67.240]) by mx.google.com with ESMTPS id l31sm4872858hsa.12.2008.11.02.06.53.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 02 Nov 2008 06:53:10 -0800 (PST) Message-ID: <490DBED4.9020708@gmail.com> Date: Sun, 02 Nov 2008 08:53:08 -0600 From: Edgar Friendly User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: David Allsopp , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Private types References: <340C8DB35D244173AE527238DB359A19@countertenor> <04092D60-3BB6-49A6-8A04-0BFE3A2081BD@erratique.ch> <5687D906367C49F981398A97A5966E09@countertenor> <20081031.090842.254669920.garrigue@math.nagoya-u.ac.jp> <490BB657.5050301@gmail.com> <6788D960DAEA460EABA915DEA52D5CA2@countertenor> <490CAE8A.8020408@gmail.com> <8E52E728B9D54B9AAF6219C7518248A7@countertenor> In-Reply-To: <8E52E728B9D54B9AAF6219C7518248A7@countertenor> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; compiler:01 unification:01 edgar:98 polymorphic:01 wrote:01 caml-list:01 interfaces:01 variant:02 argument:02 annotation:02 annotation:02 seems:03 module:03 explicit:04 explicit:04 David Allsopp wrote: > I agree that the error will still show up somewhere if there is an error - > but remember that a closed polymorphic variant type required an annotation > in the first place (in this case, the type [t] and the explicit type > annotation to use it)... so having made the explicit choice to declare the > type closed (which you either do to declare module interfaces or to try to > trap errors) the last thing (I'd say!) you want is the compiler trying to > open them back up on every unification failure! > > > David > You only declared the argument to the function as closed. This doesn't mean that the return type of the function must be that closed type. If you declared the function as returning type t, then the auto-open would run into a type roadblock before it left the function. But given your initial code, the intent of the programmer seems clear in wanting a different return type. E.