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 LAA09815; Wed, 3 Mar 2004 11:40:31 +0100 (MET) 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 LAA09616 for ; Wed, 3 Mar 2004 11:40:30 +0100 (MET) Received: from pob.cs.unibo.it (pob.cs.unibo.it [130.136.10.114]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i23AeTUM006834 for ; Wed, 3 Mar 2004 11:40:29 +0100 Received: from le1.cs.unibo.it (backle.cs.unibo.it [130.136.10.110]) by pob.cs.unibo.it (Postfix) with ESMTP id 0CEAF2A7F2; Wed, 3 Mar 2004 11:40:29 +0100 (CET) Received: from localhost.cs.unibo.it (liu.cs.unibo.it [130.136.7.125]) by le1.cs.unibo.it (8.9.3p2/8.9.3/Debian 8.9.3-21) with ESMTP id LAA19964; Wed, 3 Mar 2004 11:40:28 +0100 X-Authentication-Warning: le1.cs.unibo.it: Host liu.cs.unibo.it [130.136.7.125] claimed to be localhost.cs.unibo.it Received: by localhost.cs.unibo.it (Postfix, from userid 2662) id C76EC2ACD5; Wed, 3 Mar 2004 11:40:25 +0100 (CET) Date: Wed, 3 Mar 2004 11:40:25 +0100 From: Claudio Sacerdoti Coen To: Florian Hars Cc: caml-list@inria.fr Subject: Re: [Caml-list] Getting rid of impossible polymorphic variant tags from infered types Message-ID: <20040303104025.GA23634@cs.unibo.it> References: <4043520E.2040802@bik-gmbh.de> <20040301163532.GA7661@cs.unibo.it> <4045B30F.9000603@bik-gmbh.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4045B30F.9000603@bik-gmbh.de> User-Agent: Mutt/1.3.28i X-Operating-System: Debian GNU/Linux X-Organization: Department of computer science, University of Bologna, Eurpean Union X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; sacerdoti:01 coen:01 sacerdot:01 caml-list:01 foo:01 checker:01 foo:01 clumsy:01 sacerdoti:01 coen:01 sacerdot:01 phantom:01 polymorphic:01 syntax:02 variant:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 34 > But this gives me the worst of both worlds, no? It is a bit heavyweight, but not too bad. > I have to define a function > f_r for every type I might want to use in place of foo, Wasn't it your goal to define f_r in the first place? > *and* the type checker can still see the `Fnord that isn't there: You are right here. Indeed, you should define your own case-analysis operator (whose principal argument would have type [> `NoFnord] foo) and use it in place of the match ... with. Withouth proper syntax sugar the code becomes clumsy. This is a drawback of phantom types. > So the "| #foo_flat as v -> v :: init" version seems to be the only > workable solution. Regards, C.S.C. -- ---------------------------------------------------------------- Real name: Claudio Sacerdoti Coen PhD Student in Computer Science at University of Bologna E-mail: sacerdot@cs.unibo.it http://www.cs.unibo.it/~sacerdot ---------------------------------------------------------------- ------------------- 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