From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA13939; Mon, 23 Aug 2004 17:20:38 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 RAA12959 for ; Mon, 23 Aug 2004 17:20:37 +0200 (MET DST) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i7NFKamL000565 for ; Mon, 23 Aug 2004 17:20:36 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay02.plus.net with esmtp (Exim) id 1BzGcb-000CP9-0O for caml-list@inria.fr; Mon, 23 Aug 2004 15:20:33 +0000 From: Jon Harrop To: caml-list@inria.fr Subject: Re: [Caml-list] Phantom types Date: Mon, 23 Aug 2004 16:16:58 +0100 User-Agent: KMail/1.6.2 References: <410B5EBD.6060800@cgorski.org> <20040731163143.GB15775@fichte.ai.univie.ac.at> <200408231049.59342.jon@jdh30.plus.com> In-Reply-To: <200408231049.59342.jon@jdh30.plus.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200408231616.58139.jon@jdh30.plus.com> X-Miltered: at nez-perce with ID 412A0B44.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 val:01 val:01 abstr:01 abstr:01 superset:01 phantom:01 wrote:03 subset:03 types:03 types:03 markus:04 probably:05 cheers:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Monday 23 August 2004 10:49, Jon Harrop wrote: > Secondly, specifying the types as Markus did (e.g. [> `Even])... I should add, using: val add_even_even : [> `Even ] t -> [> `Even ] t -> [> `Even ] t val add_even_odd : [> `Even ] t -> [> `Odd ] t -> [> `Odd ] t allows: # PhantomInt.add_even_odd i j;; val k : _[> `Odd ] PhantomInt.t = which can then be misused: # PhantomInt.add_even_even i k;; - : [ `Even ] PhantomInt.t = I think this is because [> `Even] means any superset of [ `Even ] whereas [< `Even], which was probably intended, means any subset of [ `Even ]. Indeed, the latter appears to work. Cheers, Jon. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners