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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 462A6BB84 for ; Sat, 30 Aug 2008 15:58:01 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAMfuuEjAXQIm/2dsb2JhbAC1LIFp X-IronPort-AV: E=Sophos;i="4.32,297,1217800800"; d="scan'208";a="28644158" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 30 Aug 2008 15:58:01 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m7UDw0OH028283 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sat, 30 Aug 2008 15:58:00 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuIAAAPvuEjUNQVbnGdsb2JhbACSRgEBAQEBBgcIBw+iN4Fp X-IronPort-AV: E=Sophos;i="4.32,297,1217800800"; d="scan'208";a="16624376" Received: from postbode01.versateladsl.be ([212.53.5.91]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Aug 2008 15:58:00 +0200 Received: (qmail 32705 invoked by uid 0); 30 Aug 2008 13:57:38 -0000 Received: from unknown (HELO poincare.swapping.umh.ac.be) ([83.182.222.100]) (envelope-sender ) by smtp.versateladsl.be (qmail-ldap-1.03) with SMTP for < >; 30 Aug 2008 13:57:38 -0000 Received: from [127.0.0.1] (helo=localhost ident=trch) by poincare.swapping.umh.ac.be with esmtp (Exim 4.69) (envelope-from ) id 1KZQxe-00042D-6h; Sat, 30 Aug 2008 15:57:54 +0200 Date: Sat, 30 Aug 2008 15:57:54 +0200 (CEST) Message-Id: <20080830.155754.457039520284782231.Christophe.Troestler+ocaml@umh.ac.be> To: rich@annexia.org Cc: caml-list@inria.fr Subject: Re: [Caml-list] What does underscore mean in this type expression? From: Christophe TROESTLER In-Reply-To: <20080830130310.GA27910@annexia.org> References: <20080830112718.GA25303@annexia.org> <20080830.133831.122629365592826302.Christophe.Troestler+ocaml@umh.ac.be> <20080830130310.GA27910@annexia.org> X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: University of Mons-Hainaut X-Mailer: Mew version 6.0.51 on Emacs 22.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 48B951E8.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 0100,:01 val:01 mli:01 ocamlc:01 mli:01 ocamlc:01 checker:01 compiler:01 wrote:01 caml-list:01 On Sat, 30 Aug 2008 14:03:10 +0100, Richard Jones wrote: > > > # let x = ref `X;; > > val x : _[> `X ] ref = {contents = `X} > > OK ... so how to get rid of the error? Even supplying a full type for > get_domains in the implementation doesn't get rid of it. > > Here's the code if anyone wishes to try: > > http://www.annexia.org/tmp/libvirt.mli > http://www.annexia.org/tmp/libvirt.ml > > $ ocamlc -c libvirt.mli > $ ocamlc -c libvirt.ml Here is the crux of your problem let f = let a = ref 0 in fun (x : [> `R ]) -> x;; If you hoist [let have_list_all_domains = ref None] outside [let get_domains], then it works fine. The type checker could certainly be slightly improved [1] there but I do not know how difficult it is. C. --- [1] And maybe also the compiler: a rough check seem to indicate that hiding the variable in the definition of f is slightly slower.