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 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 197F6BC69 for ; Wed, 5 Dec 2007 16:59:27 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAM5ZVkeGnQCBnmdsb2JhbACPVwEBAQEHBAYRGA X-IronPort-AV: E=Sophos;i="4.23,254,1194217200"; d="scan'208";a="6508542" Received: from shiva.jussieu.fr ([134.157.0.129]) by mail3-smtp-sop.national.inria.fr with ESMTP; 05 Dec 2007 16:59:27 +0100 Received: from hydrogene.pps.jussieu.fr (hydrogene.pps.jussieu.fr [134.157.168.1]) by shiva.jussieu.fr (8.13.8/jtpda-5.4) with ESMTP id lB5FxCmr090861 ; Wed, 5 Dec 2007 16:59:13 +0100 (CET) X-Ids: 165 Received: from [134.157.168.28] (glondu@nickel.pps.jussieu.fr [134.157.168.28]) by hydrogene.pps.jussieu.fr (8.13.4/jtpda-5.4) with ESMTP id lB5FxBmP016310 ; Wed, 5 Dec 2007 16:59:11 +0100 Message-ID: <4756CACF.5080008@glondu.net> Date: Wed, 05 Dec 2007 16:59:11 +0100 From: Stephane Glondu User-Agent: Mozilla-Thunderbird 2.0.0.6 (X11/20071009) MIME-Version: 1.0 To: Jacques GARRIGUE Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Union of polymorphic variants... References: <47554A47.0@glondu.net> <20071204.225712.186423247.garrigue@math.nagoya-u.ac.jp> <4755651C.5010407@glondu.net> <20071205.111718.2004158852.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20071205.111718.2004158852.garrigue@math.nagoya-u.ac.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (shiva.jussieu.fr [134.157.0.165]); Wed, 05 Dec 2007 16:59:13 +0100 (CET) X-Virus-Scanned: ClamAV 0.88.7/5011/Wed Dec 5 10:42:23 2007 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at shiva.jussieu.fr with ID 4756CAD1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; variants:01 bool:01 steph:98 polymorphic:01 char:01 caml-list:01 garrigue:03 jacques:03 let:03 types:05 problem:05 ecrit:06 trick:06 stephane:07 stephane:07 Jacques GARRIGUE a écrit : > Nothing is "difficult". But not everything is well-defined... > The question is where do we start, where do we stop. > > type a = [`S of a | `Z] > > should #a be (`S _ | `Z) or (`S (`S _ | `Z) | `Z) or ...? OK, I grasp now the difficulty of the problem. > Note that you can still build the types by hand > > type 'a t = [`A of 'a] > type b = [`B of bool] > type c = [`C of char] > type a = [b|c] t > > let f = function > `A #b as x -> fb x > | `A #c as x -> fc x I didn't know this trick. Thanks, -- Stéphane Glondu