From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA27510 for caml-redist; Fri, 12 May 2000 19:09:43 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA29938 for ; Fri, 12 May 2000 17:17:17 +0200 (MET DST) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e4CFHGb01042 for ; Fri, 12 May 2000 17:17:16 +0200 (MET DST) Received: from pc87.lri.fr (pc87 [129.175.8.106]) by ext.lri.fr (8.9.3/jtpda-5.3.2) with ESMTP id QAA20844 for ; Fri, 12 May 2000 16:34:28 +0200 (MET DST) Received: from pc87.lri.fr by pc87.lri.fr (8.9.3/feuille) with ESMTP id QAA12123 for ; Fri, 12 May 2000 16:34:11 +0200 Message-Id: <200005121434.QAA12123@pc87.lri.fr> Date: Fri, 12 May 2000 16:34:08 +0200 (MEST) From: Judicael Courant Subject: Typechecking of recursive variants To: caml-list@pauillac.inria.fr MIME-Version: 1.0 Content-Type: TEXT/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Sender: weis Hello, I do not understand the following behavior of the typechecker : match x 4 with `X z -> z | `Y -> assert false;; - : [ `Y | `X of '_a] as 'a = `X (`X (`X `Y)) Objective Caml version 3.00 # let rec x n = if n = 0 then `Y else `X (x (n-1));; val x : int -> ([> `Y | `X of 'a] as 'a) = # x 3;; - : _[> `Y | `X of '_a] as 'a = `X (`X (`X `Y)) # match x 4 with `X z -> z | `Y -> assert false;; - : [ `Y | `X of '_a] as 'a = `X (`X (`X `Y)) What do these underscores mean ? Anything to do with monomorphic type variables ? Why is not there any ">" at the beginning of the latest type ? Judicaël. -- Judicael.Courant@lri.fr, http://www.lri.fr/~jcourant/ (+33) (0)1 69 15 64 85 "Montre moi des morceaux de ton monde, et je te montrerai le mien" Tim, matricule #929, condamné ŕ mort. http://rozenn.picard.free.fr/tim.html