From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id ED520BB81 for ; Sun, 19 Mar 2006 15:56:49 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k2JEun6i023085 for ; Sun, 19 Mar 2006 15:56:49 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA23952 for ; Sun, 19 Mar 2006 15:56:48 +0100 (MET) Received: from mail17.bluewin.ch (mail17.bluewin.ch [195.186.18.64]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k2JEumjo023082 for ; Sun, 19 Mar 2006 15:56:48 +0100 Received: from [10.0.1.2] (81.62.68.188) by mail17.bluewin.ch (Bluewin 7.2.071) id 43E4A10900D53A6A for caml-list@inria.fr; Sun, 19 Mar 2006 14:56:47 +0000 Mime-Version: 1.0 (Apple Message framework v746.3) In-Reply-To: <20060319.202149.108734866.garrigue@math.nagoya-u.ac.jp> References: <20060319.202149.108734866.garrigue@math.nagoya-u.ac.jp> Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <3DDD7978-174E-4E47-8F35-3508FDA31964@epfl.ch> Content-Transfer-Encoding: quoted-printable From: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Subject: Re: [Caml-list] Typing problem Date: Sun, 19 Mar 2006 15:58:05 +0100 To: Caml list X-Mailer: Apple Mail (2.746.3) X-Miltered: at concorde with ID 441D7131.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 441D7130.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bunzli:01 buenzli:01 epfl:01 constructors:01 bigarray:01 statically:01 woodyatt:01 constructors:01 23,:98 caml-list:01 typing:01 functions:01 jacques:01 constraint:01 parameter:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Le 19 mars 06 =E0 12:21, Jacques Garrigue a =E9crit : > The properties you describe are guaranteed, because all values must be > created through M.a and M.b. I thought about that but I wanted to avoid the need to go through =20 constructors functions (or values =E0 la bigarray). Maybe I'll simply =20= statically check a little less. It's a tradeoff. Le 19 mars 06 =E0 15:23, j h woodyatt a =E9crit : > However, 'b is concrete in your example, so-- if it's fully =20 > representative of your code-- you could just do this, and you would =20= > still have only one type parameter: > > type 'a t =3D [ `A of 'a | `B of [ `U1 ] ] > constraint 'a =3D [< u ] This won't work because, as I said, I use 'a to express static =20 constraints about the value stored in the constructors therefore 'a =20 must be [`U1] whenever a `B is constructed and this is not enforced =20 by this definition. Having more parameters is not an option either. Thanks to both of you for your input. Daniel