From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 675F0BCAE for ; Thu, 30 Jun 2005 23:42:35 +0200 (CEST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j5ULgZGV003803 for ; Thu, 30 Jun 2005 23:42:35 +0200 Received: from hydrogene.pps.jussieu.fr (hydrogene.pps.jussieu.fr [134.157.168.1]) by shiva.jussieu.fr (8.12.11/jtpda-5.4) with ESMTP id j5ULgYVh048215 ; Thu, 30 Jun 2005 23:42:34 +0200 (CEST) X-Ids: 165 Received: from hydrogene.pps.jussieu.fr (localhost.localdomain [127.0.0.1]) by hydrogene.pps.jussieu.fr (8.13.4/jtpda-5.4) with ESMTP id j5ULgXFC029834 ; Thu, 30 Jun 2005 23:42:33 +0200 Received: from localhost (verlague@localhost) by hydrogene.pps.jussieu.fr (8.13.4/8.13.2/Submit) with ESMTP id j5ULgXbZ029831; Thu, 30 Jun 2005 23:42:33 +0200 Date: Thu, 30 Jun 2005 23:42:33 +0200 (CEST) From: Julien Verlaguet To: Andreas Rossberg Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] bizarre type In-Reply-To: <000d01c57dab$21871e30$14b2a8c0@wiko> Message-ID: References: <42C4228D.3080000@ps.uni-sb.de> <000d01c57dab$21871e30$14b2a8c0@wiko> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.7.2 (shiva.jussieu.fr [134.157.0.165]); Thu, 30 Jun 2005 23:42:34 +0200 (CEST) X-Antivirus: scanned by sophie at shiva.jussieu.fr X-Miltered: at concorde with ID 42C4674B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at shiva.jussieu.fr with ID 42C4674A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 compiler:01 bool:01 disturbs:01 wrote:01 wrote:01 pps:01 marshal:01 jussieu:01 writting:01 strings:01 int:01 constraint:01 defined:01 string:03 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: > Well, since '_a t = int t the compiler can freely choose either for > printing. Or bool t, for that matter. agreed. > Yes, but that's not what you did in the other example. You wrote (x : 'a > t) - and because of the way t was defined this was as good as writing (x : > string) and hence did not induce any additional constraint. Ok, I have to aggree. In fact it prevents me from writting this : type 'a marshalled=string let make (x : 'a)=(Marshal.to_string x [] : 'a marshalled);; And then do all type of operations in a type safe way on strings. I have to aggree though that I wrote 'a t=string and therefore one should be able to exchange them. The only tiny thing that disturbs me is that in my previous example : let g (x : 'a t) (y : 'a) the type of y depends on the 'a present in 'a t. It is odd. But I have to admit it's correct. Thanks for your help. J