From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p8TAo3jO027583 for ; Thu, 29 Sep 2011 12:50:03 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtUBAAlMhE6flYLKi2dsb2JhbABBDqd+FAEBAQoLCxslgVMBAQQBJ1cLCxguAlUGiA24DIcTBJNWhRGLcjk X-IronPort-AV: E=Sophos;i="4.68,460,1312149600"; d="ml'?mli'?scan'208";a="111112607" Received: from smtp.dico.unimi.it ([159.149.130.202]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Sep 2011 12:50:01 +0200 Received: from ulik.disi.unige.it (ulik.disi.unige.it [130.251.61.165]) (authenticated bits=0) by smtp.dico.unimi.it (8.14.4/8.14.4) with ESMTP id p8TAo0Rg017860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 29 Sep 2011 12:50:00 +0200 Date: Thu, 29 Sep 2011 12:27:13 +0200 (CEST) From: Walter Cazzola To: Jacques Garrigue In-Reply-To: <266E7048-C3BB-4B9E-9760-9D52993A1C86@math.nagoya-u.ac.jp> Message-ID: References: <6A020199-D53D-443E-9683-D225D495AEB5@math.nagoya-u.ac.jp> <091F94EF-9F08-41E2-8AD7-415548045A72@free.fr> <266E7048-C3BB-4B9E-9760-9D52993A1C86@math.nagoya-u.ac.jp> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-70146577-1317292038=:4431" ReSent-Date: Thu, 29 Sep 2011 12:49:46 +0200 (CEST) ReSent-From: Walter Cazzola ReSent-To: OCaML Mailing List ReSent-Subject: Re: [Caml-list] still silly issues on polymorphic types ReSent-Message-ID: ReSent-User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (smtp.dico.unimi.it [159.149.130.202]); Thu, 29 Sep 2011 12:50:00 +0200 (CEST) X-DSI-MailScanner-Information: Please contact the staff for more information X-DSI-MailScanner-ID: p8TAo0Rg017860 X-DSI-MailScanner: Found to be clean X-DSI-MailScanner-From: cazzola@dico.unimi.it Subject: Re: [Caml-list] still silly issues on polymorphic types --8323328-70146577-1317292038=:4431 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Hi all, On Wed, 28 Sep 2011, Jacques Garrigue wrote: > On 2011/09/28, at 5:22, Walter Cazzola wrote: > >> I still have one problem: how can I assign to a the type 'a list? by >> using «type a= 'a list» I get >> >> Error: Unbound type parameter 'a > > Same thing: you need to make explicit the contents of the list. > So this can be type a = int list. > On the other hand if you are trying to refine the signature, you > can also write > type t > type a = t list > keeping t abstract. thanks for the explanation but I'm still unable to match the 2 types (I have attached the code again). I get this message: # module M0 = Continuation(StringConcat);; Error: Signature mismatch: Modules do not match: sig type t = StringConcat.t type a = t list and b = t and c = t list val op : 'a -> 'a list -> 'a list val init : 'a list end is not included in OpVarADT.OpVarADT Values do not match: val op : 'a -> 'a list -> 'a list is not included in val op : a -> b -> c I have also tried to set the abstract type t to string butwithout any luck. # module M0 = Continuation(StringConcat with StringConcat.t = string) ;; Error: Syntax error I feel myself quite dumb but I can't figure out how to fix it. Walter -- --8323328-70146577-1317292038=:4431 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=continuation.ml Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=continuation.ml bW9kdWxlIENvbnRpbnVhdGlvbiAoT1AgOiBPcFZhckFEVC5PcFZhckFEVCkg PSANCiAgc3RydWN0DQogICAgbGV0IGFyZyB4ID0gZnVuIHkgY29udGludWF0 aW9uIC0+IGNvbnRpbnVhdGlvbiAoT1Aub3AgeCB5KSA7Ow0KICAgIGxldCBz dG9wIHggPSB4OzsNCiAgICBsZXQgZiBnID0gZyBPUC5pbml0OzsNCiAgZW5k DQo= --8323328-70146577-1317292038=:4431 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=OpVarADT.mli Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=OpVarADT.mli bW9kdWxlIHR5cGUgT3BWYXJBRFQgPSANCiBzaWcNCiAgIHR5cGUgYSBhbmQg YiBhbmQgYw0KICAgdmFsIG9wOiBhIC0+IGIgLT4gYw0KICAgdmFsIGluaXQg OiBjDQogZW5kDQo= --8323328-70146577-1317292038=:4431 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=concat.ml Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=concat.ml bW9kdWxlIFN0cmluZ0NvbmNhdCA9IHN0cnVjdA0KICB0eXBlIHQNCiAgdHlw ZSBhPXQgbGlzdCBhbmQgYj10IGFuZCBjPXQgbGlzdA0KICBsZXQgb3AgPSBm dW4geCB5IC0+IHkgQCBbeF0gOzsNCiAgbGV0IGluaXQgPSBbXSA7Ow0KZW5k DQo= --8323328-70146577-1317292038=:4431--