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 p8RBkKpu013126 for ; Tue, 27 Sep 2011 13:46:20 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjkBAFS3gU6flYLKl2dsb2JhbABCp3cUAQEBAQEIFgc6ggGBNU8MoSefb4cLBJNShRASjBQ X-IronPort-AV: E=Sophos;i="4.68,449,1312149600"; d="ml'?mli'?scan'208";a="110734062" Received: from smtp.dico.unimi.it ([159.149.130.202]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Sep 2011 13:46:00 +0200 Received: from [172.16.154.66] (wless.dsi.unimi.it [159.149.130.72]) (authenticated bits=0) by smtp.dico.unimi.it (8.14.4/8.14.4) with ESMTP id p8RBjxNL016103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 27 Sep 2011 13:45:59 +0200 Date: Tue, 27 Sep 2011 13:46:02 +0200 (CEST) From: Walter Cazzola To: OCaML Mailing List Message-ID: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-196475124-1317123962=:8918" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (smtp.dico.unimi.it [159.149.130.202]); Tue, 27 Sep 2011 13:45:59 +0200 (CEST) X-DSI-MailScanner-Information: Please contact the staff for more information X-DSI-MailScanner-ID: p8RBjxNL016103 X-DSI-MailScanner: Found to be clean X-DSI-MailScanner-From: cazzola@dico.unimi.it Subject: [Caml-list] still silly issues on polymorphic types This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-196475124-1317123962=:8918 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Dear all, I'm still playing around with functors, modules and polymorphism but I've some problems with this last concept. In the attached files I have tried to implement a sort of function with a variable number of arguments (based on continuation) and to generalize the approach I've used a functor (OpVarADT) where I defined the operation of type 'a -> 'b -> 'c but seems that it is not general enough to contain int->int->int or 'a -> 'a list -> 'a list This is the functor instantiation with the errors I get: # module M0 = Continuation(StringConcat) ;; Error: Signature mismatch: Modules do not match: sig 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 # module M1 = Continuation(Sum) ;; Error: Signature mismatch: Modules do not match: sig val op : int -> int -> int val init : int end is not included in OpVarADT.OpVarADT Values do not match: val op : int -> int -> int is not included in val op : 'a -> 'b -> 'c I'm sure I'm doing something wrong but I can't see what, any help is welcome TIA Walter -- --8323328-196475124-1317123962=:8918 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=sum.ml Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=sum.ml bW9kdWxlIFN1bSA9IHN0cnVjdA0KICBsZXQgb3AgPSBmdW4geCB5IC0+IHgr eSA7Ow0KICBsZXQgaW5pdCA9IDAgOzsNCmVuZA0K --8323328-196475124-1317123962=:8918 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=OpVarADT.mli Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=OpVarADT.mli bW9kdWxlIHR5cGUgT3BWYXJBRFQgPSANCiBzaWcNCiAgIHZhbCBvcDogJ2Eg LT4gJ2IgLT4gJ2MNCiAgIHZhbCBpbml0IDogJ2MNCiBlbmQNCg== --8323328-196475124-1317123962=:8918 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-196475124-1317123962=:8918 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=concat.ml Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=concat.ml bW9kdWxlIFN0cmluZ0NvbmNhdCA9IHN0cnVjdA0KICBsZXQgb3AgPSBmdW4g eCB5IC0+IHkgQCBbeF0gOzsNCiAgbGV0IGluaXQgPSBbXSA7Ow0KZW5kDQo= --8323328-196475124-1317123962=:8918--