From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p2S7s17X018846 for ; Mon, 28 Mar 2011 09:54:01 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMCAMM9kE3B/BfXkWdsb2JhbAClShQBAQEBCQsLBxQDIsBbhWkEjHeDVBo X-IronPort-AV: E=Sophos;i="4.63,253,1299452400"; d="scan'208";a="79273374" Received: from unknown (HELO msa.smtpout.orange.fr) ([193.252.23.215]) by mail3-smtp-sop.national.inria.fr with ESMTP; 28 Mar 2011 09:53:55 +0200 Received: from [192.168.1.63] ([83.204.241.208]) by mwinf5d41 with ME id QXts1g00L4WVC3X03XtsUq; Mon, 28 Mar 2011 09:53:53 +0200 Message-ID: <4D903E90.4080907@frisch.fr> Date: Mon, 28 Mar 2011 09:53:52 +0200 From: Alain Frisch User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: caml-list References: <89643D7F-B0F9-4452-BBAF-0445D9D3CA4E@gmail.com> <639CCD2C-402F-4754-B942-B460FD908A95@gmail.com> <63968844-AD95-4359-80F0-E9E071CF6518@mpi-sws.org> <20110325164240.GT10028@localhost> <46B666E2-4575-4E79-ACF1-FE0789C0C76B@mpi-sws.org> <20110325190129.GU10028@localhost> In-Reply-To: <20110325190129.GU10028@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Re: module typing issue On 03/25/2011 08:01 PM, Guillaume Yziquel wrote: > type error = private int > > external get_error : unit -> error = "zzz" > > You get some error level that you can pattern match as an int, and this > also enforces that all values of type error come from a call to > get_error. You need to coerce explicitly from type error to type int (... :> int), so this is not really different from defining error as an abstract type and exposing a function error->int. -- Alain